comparison svr-authpubkey.c @ 761:ac2158e3e403 ecc

ecc kind of works, needs fixing/testing
author Matt Johnston <matt@ucc.asn.au>
date Sun, 07 Apr 2013 01:36:42 +0800
parents a98a2138364a
children a78a38e402d1
comparison
equal deleted inserted replaced
760:f336d232fc63 761:ac2158e3e403
124 } 124 }
125 125
126 /* create the data which has been signed - this a string containing 126 /* create the data which has been signed - this a string containing
127 * session_id, concatenated with the payload packet up to the signature */ 127 * session_id, concatenated with the payload packet up to the signature */
128 signbuf = buf_new(ses.payload->pos + 4 + SHA1_HASH_SIZE); 128 signbuf = buf_new(ses.payload->pos + 4 + SHA1_HASH_SIZE);
129 buf_putstring(signbuf, ses.session_id, SHA1_HASH_SIZE); 129 buf_putbufstring(signbuf, ses.session_id);
130 buf_putbytes(signbuf, ses.payload->data, ses.payload->pos); 130 buf_putbytes(signbuf, ses.payload->data, ses.payload->pos);
131 buf_setpos(signbuf, 0); 131 buf_setpos(signbuf, 0);
132 132
133 /* ... and finally verify the signature */ 133 /* ... and finally verify the signature */
134 fp = sign_key_fingerprint(keyblob, keybloblen); 134 fp = sign_key_fingerprint(keyblob, keybloblen);
135 if (buf_verify(ses.payload, key, buf_getptr(signbuf, signbuf->len), 135 if (buf_verify(ses.payload, key, signbuf) == DROPBEAR_SUCCESS) {
136 signbuf->len) == DROPBEAR_SUCCESS) {
137 dropbear_log(LOG_NOTICE, 136 dropbear_log(LOG_NOTICE,
138 "Pubkey auth succeeded for '%s' with key %s from %s", 137 "Pubkey auth succeeded for '%s' with key %s from %s",
139 ses.authstate.pw_name, fp, svr_ses.addrstring); 138 ses.authstate.pw_name, fp, svr_ses.addrstring);
140 send_msg_userauth_success(); 139 send_msg_userauth_success();
141 } else { 140 } else {