comparison signkey.c @ 316:dc6173e09ff7 ucc-axis-hack

smaller yet again
author Matt Johnston <matt@ucc.asn.au>
date Tue, 28 Mar 2006 16:04:11 +0000
parents eb7b9f2bb8e8
children
comparison
equal deleted inserted replaced
314:827f87dfbc22 316:dc6173e09ff7
257 257
258 m_free(key); 258 m_free(key);
259 TRACE(("leave sign_key_free")) 259 TRACE(("leave sign_key_free"))
260 } 260 }
261 261
262 /* don't need fingerprints */
263 #if 0
264
262 static char hexdig(unsigned char x) { 265 static char hexdig(unsigned char x) {
263 266
264 if (x > 0xf) 267 if (x > 0xf)
265 return 'X'; 268 return 'X';
266 269
351 return sign_key_md5_fingerprint(keyblob, keybloblen); 354 return sign_key_md5_fingerprint(keyblob, keybloblen);
352 #else 355 #else
353 return sign_key_sha1_fingerprint(keyblob, keybloblen); 356 return sign_key_sha1_fingerprint(keyblob, keybloblen);
354 #endif 357 #endif
355 } 358 }
359 #endif
356 360
357 void buf_put_sign(buffer* buf, sign_key *key, int type, 361 void buf_put_sign(buffer* buf, sign_key *key, int type,
358 const unsigned char *data, unsigned int len) { 362 const unsigned char *data, unsigned int len) {
359 363
360 buffer *sigblob; 364 buffer *sigblob;
382 buf_free(sigblob); 386 buf_free(sigblob);
383 387
384 } 388 }
385 389
386 #ifdef DROPBEAR_SIGNKEY_VERIFY 390 #ifdef DROPBEAR_SIGNKEY_VERIFY
391 #error Get rid of this line if you intended to have pubkey auth
387 /* Return DROPBEAR_SUCCESS or DROPBEAR_FAILURE. 392 /* Return DROPBEAR_SUCCESS or DROPBEAR_FAILURE.
388 * If FAILURE is returned, the position of 393 * If FAILURE is returned, the position of
389 * buf is undefined. If SUCCESS is returned, buf will be positioned after the 394 * buf is undefined. If SUCCESS is returned, buf will be positioned after the
390 * signature blob */ 395 * signature blob */
391 int buf_verify(buffer * buf, sign_key *key, const unsigned char *data, 396 int buf_verify(buffer * buf, sign_key *key, const unsigned char *data,
426 return DROPBEAR_FAILURE; 431 return DROPBEAR_FAILURE;
427 } 432 }
428 #endif /* DROPBEAR_SIGNKEY_VERIFY */ 433 #endif /* DROPBEAR_SIGNKEY_VERIFY */
429 434
430 #ifdef DROPBEAR_KEY_LINES /* ie we're using authorized_keys or known_hosts */ 435 #ifdef DROPBEAR_KEY_LINES /* ie we're using authorized_keys or known_hosts */
436 #error Get rid of this line if you intended to have pubkey auth
431 437
432 /* Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE when given a buffer containing 438 /* Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE when given a buffer containing
433 * a key, a key, and a type. The buffer is positioned at the start of the 439 * a key, a key, and a type. The buffer is positioned at the start of the
434 * base64 data, and contains no trailing data */ 440 * base64 data, and contains no trailing data */
435 int cmp_base64_key(const unsigned char* keyblob, unsigned int keybloblen, 441 int cmp_base64_key(const unsigned char* keyblob, unsigned int keybloblen,