comparison ecc.c @ 1478:3a933956437e coverity

update coverity
author Matt Johnston <matt@ucc.asn.au>
date Fri, 09 Feb 2018 23:49:22 +0800
parents 06d52bcb8094
children b0c3b46372dc
comparison
equal deleted inserted replaced
1439:8d24733026c5 1478:3a933956437e
80 return key; 80 return key;
81 } 81 }
82 82
83 /* Copied from libtomcrypt ecc_import.c (version there is static), modified 83 /* Copied from libtomcrypt ecc_import.c (version there is static), modified
84 for different mp_int pointer without LTC_SOURCE */ 84 for different mp_int pointer without LTC_SOURCE */
85 static int ecc_is_point(ecc_key *key) 85 static int ecc_is_point(const ecc_key *key)
86 { 86 {
87 mp_int *prime, *b, *t1, *t2; 87 mp_int *prime, *b, *t1, *t2;
88 int err; 88 int err;
89 89
90 m_mp_alloc_init_multi(&prime, &b, &t1, &t2, NULL); 90 m_mp_alloc_init_multi(&prime, &b, &t1, &t2, NULL);
211 211
212 } 212 }
213 213
214 /* a modified version of libtomcrypt's "ecc_shared_secret" to output 214 /* a modified version of libtomcrypt's "ecc_shared_secret" to output
215 a mp_int instead. */ 215 a mp_int instead. */
216 mp_int * dropbear_ecc_shared_secret(ecc_key *public_key, ecc_key *private_key) 216 mp_int * dropbear_ecc_shared_secret(ecc_key *public_key, const ecc_key *private_key)
217 { 217 {
218 ecc_point *result = NULL; 218 ecc_point *result = NULL;
219 mp_int *prime = NULL, *shared_secret = NULL; 219 mp_int *prime = NULL, *shared_secret = NULL;
220 int err = DROPBEAR_FAILURE; 220 int err = DROPBEAR_FAILURE;
221 221