comparison ecdsa.c @ 796:069b875031f5 ecc

Fix ecdsa verification
author Matt Johnston <matt@ucc.asn.au>
date Thu, 09 May 2013 23:24:05 +0800
parents 7f604f9b3756
children 7dcb46da72d9
comparison
equal deleted inserted replaced
795:7f604f9b3756 796:069b875031f5
246 unsigned int ident_len; 246 unsigned int ident_len;
247 unsigned int sig_len; 247 unsigned int sig_len;
248 unsigned int sig_pos; 248 unsigned int sig_pos;
249 unsigned char key_ident[30]; 249 unsigned char key_ident[30];
250 250
251 ident = buf_getstring(buf, &ident_len);
252 snprintf((char*)key_ident, sizeof(key_ident), "ecdsa-sha2-%s", curve->name);
253 if (strlen((char*)key_ident) != ident_len) {
254 goto out;
255 }
256 if (memcmp(key_ident, ident, ident_len) != 0) {
257 goto out;
258 }
259 sig_len = buf_getint(buf); 251 sig_len = buf_getint(buf);
260 sig_pos = buf->pos; 252 sig_pos = buf->pos;
261 if (buf_getmpint(buf, r) != DROPBEAR_SUCCESS) { 253 if (buf_getmpint(buf, r) != DROPBEAR_SUCCESS) {
262 goto out; 254 goto out;
263 } 255 }