comparison ecdsa.c @ 852:7540c0822374 ecc

Various cleanups and fixes for warnings
author Matt Johnston <matt@ucc.asn.au>
date Tue, 12 Nov 2013 23:02:32 +0800
parents b298bb438625
children 04ede40a529a
comparison
equal deleted inserted replaced
851:c1c1b43f78c2 852:7540c0822374
244 } 244 }
245 } 245 }
246 246
247 // returns values in s and r 247 // returns values in s and r
248 // returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE 248 // returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE
249 static int buf_get_ecdsa_verify_params(buffer *buf, struct dropbear_ecc_curve *curve, 249 static int buf_get_ecdsa_verify_params(buffer *buf,
250 void *r, void* s) { 250 void *r, void* s) {
251 int ret = DROPBEAR_FAILURE; 251 int ret = DROPBEAR_FAILURE;
252 unsigned int sig_len; 252 unsigned int sig_len;
253 unsigned int sig_pos; 253 unsigned int sig_pos;
254 254
255 sig_len = buf_getint(buf); 255 sig_len = buf_getint(buf);
300 || !mG 300 || !mG
301 || !mQ) { 301 || !mQ) {
302 dropbear_exit("ECC error"); 302 dropbear_exit("ECC error");
303 } 303 }
304 304
305 if (buf_get_ecdsa_verify_params(buf, curve, r, s) != DROPBEAR_SUCCESS) { 305 if (buf_get_ecdsa_verify_params(buf, r, s) != DROPBEAR_SUCCESS) {
306 goto out; 306 goto out;
307 } 307 }
308 308
309 curve->hash_desc->init(&hs); 309 curve->hash_desc->init(&hs);
310 curve->hash_desc->process(&hs, data_buf->data, data_buf->len); 310 curve->hash_desc->process(&hs, data_buf->data, data_buf->len);