comparison signkey.c @ 34:e2a1eaa19f22

Client mostly works up to password auth Need to rework algo-choosing etc, since server is now broken.
author Matt Johnston <matt@ucc.asn.au>
date Wed, 28 Jul 2004 16:44:16 +0000
parents 0969767bca0d
children b4874d772210
comparison
equal deleted inserted replaced
33:f789045062e6 34:e2a1eaa19f22
50 int buf_get_pub_key(buffer *buf, sign_key *key, int *type) { 50 int buf_get_pub_key(buffer *buf, sign_key *key, int *type) {
51 51
52 unsigned char* ident; 52 unsigned char* ident;
53 unsigned int len; 53 unsigned int len;
54 54
55 TRACE(("enter buf_get_pub_key"));
56 printhex(buf_getptr(buf, 0x99), 0x99);
57
55 ident = buf_getstring(buf, &len); 58 ident = buf_getstring(buf, &len);
59
56 60
57 #ifdef DROPBEAR_DSS 61 #ifdef DROPBEAR_DSS
58 if (memcmp(ident, SSH_SIGNKEY_DSS, len) == 0 62 if (memcmp(ident, SSH_SIGNKEY_DSS, len) == 0
59 && (*type == DROPBEAR_SIGNKEY_ANY 63 && (*type == DROPBEAR_SIGNKEY_ANY
60 || *type == DROPBEAR_SIGNKEY_DSS)) { 64 || *type == DROPBEAR_SIGNKEY_DSS)) {
76 key->rsakey = (rsa_key*)m_malloc(sizeof(rsa_key)); 80 key->rsakey = (rsa_key*)m_malloc(sizeof(rsa_key));
77 *type = DROPBEAR_SIGNKEY_RSA; 81 *type = DROPBEAR_SIGNKEY_RSA;
78 return buf_get_rsa_pub_key(buf, key->rsakey); 82 return buf_get_rsa_pub_key(buf, key->rsakey);
79 } 83 }
80 #endif 84 #endif
85 TRACE(("leave buf_get_pub_key: didn't match the type we want (%d versus '%s'len %d)", *type, ident, len));
81 86
82 m_free(ident); 87 m_free(ident);
83 88
84 return DROPBEAR_FAILURE; 89 return DROPBEAR_FAILURE;
85 90
350 355
351 unsigned int bloblen; 356 unsigned int bloblen;
352 unsigned char * ident = NULL; 357 unsigned char * ident = NULL;
353 unsigned int identlen = 0; 358 unsigned int identlen = 0;
354 359
360 TRACE(("enter buf_verify"));
361
355 bloblen = buf_getint(buf); 362 bloblen = buf_getint(buf);
356 ident = buf_getstring(buf, &identlen); 363 ident = buf_getstring(buf, &identlen);
357 364
358 #ifdef DROPBEAR_DSS 365 #ifdef DROPBEAR_DSS
359 if (bloblen == DSS_SIGNATURE_SIZE && 366 if (bloblen == DSS_SIGNATURE_SIZE &&