From bd6c37adb6a5c3e341788a4255c138e0d71ecb48 Mon Sep 17 00:00:00 2001 From: Gaël PORTAY Date: Sat, 2 May 2015 22:24:02 +0200 Subject: Turn local key_indent variable into char * --- ecdsa.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ecdsa.c') diff --git a/ecdsa.c b/ecdsa.c index 4fee796..8f4c6a9 100644 --- a/ecdsa.c +++ b/ecdsa.c @@ -140,11 +140,11 @@ ecc_key *buf_get_ecdsa_priv_key(buffer *buf) { void buf_put_ecdsa_pub_key(buffer *buf, ecc_key *key) { struct dropbear_ecc_curve *curve = NULL; - unsigned char key_ident[30]; + char key_ident[30]; curve = curve_for_dp(key->dp); - snprintf((char*)key_ident, sizeof(key_ident), "ecdsa-sha2-%s", curve->name); - buf_putstring(buf, key_ident, strlen(key_ident)); + snprintf(key_ident, sizeof(key_ident), "ecdsa-sha2-%s", curve->name); + buf_putstring(buf, (const unsigned char *) key_ident, strlen(key_ident)); buf_putstring(buf, curve->name, strlen(curve->name)); buf_put_ecc_raw_pubkey_string(buf, key); } @@ -161,7 +161,7 @@ void buf_put_ecdsa_sign(buffer *buf, ecc_key *key, buffer *data_buf) { hash_state hs; unsigned char hash[64]; void *e = NULL, *p = NULL, *s = NULL, *r; - unsigned char key_ident[30]; + char key_ident[30]; buffer *sigbuf = NULL; TRACE(("buf_put_ecdsa_sign")) @@ -222,8 +222,8 @@ void buf_put_ecdsa_sign(buffer *buf, ecc_key *key, buffer *data_buf) { } } - snprintf((char*)key_ident, sizeof(key_ident), "ecdsa-sha2-%s", curve->name); - buf_putstring(buf, key_ident, strlen(key_ident)); + snprintf(key_ident, sizeof(key_ident), "ecdsa-sha2-%s", curve->name); + buf_putstring(buf, (const unsigned char *) key_ident, strlen(key_ident)); /* enough for nistp521 */ sigbuf = buf_new(200); buf_putmpint(sigbuf, (mp_int*)r); -- cgit v1.2.3 From 449ddae628ea23f8b1e7179ab3ff2c81cffa57a0 Mon Sep 17 00:00:00 2001 From: Gaël PORTAY Date: Sat, 2 May 2015 13:59:41 +0200 Subject: Turn dropbear_ecc_curve's name into const char * --- ecc.h | 2 +- ecdsa.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'ecdsa.c') diff --git a/ecc.h b/ecc.h index 703c717..93f85cf 100644 --- a/ecc.h +++ b/ecc.h @@ -12,7 +12,7 @@ struct dropbear_ecc_curve { int ltc_size; /* to match the byte sizes in ltc_ecc_sets[] */ const ltc_ecc_set_type *dp; /* curve domain parameters */ const struct ltc_hash_descriptor *hash_desc; - const unsigned char *name; + const char *name; }; extern struct dropbear_ecc_curve ecc_curve_nistp256; diff --git a/ecdsa.c b/ecdsa.c index 8f4c6a9..f5c7755 100644 --- a/ecdsa.c +++ b/ecdsa.c @@ -145,7 +145,7 @@ void buf_put_ecdsa_pub_key(buffer *buf, ecc_key *key) { curve = curve_for_dp(key->dp); snprintf(key_ident, sizeof(key_ident), "ecdsa-sha2-%s", curve->name); buf_putstring(buf, (const unsigned char *) key_ident, strlen(key_ident)); - buf_putstring(buf, curve->name, strlen(curve->name)); + buf_putstring(buf, (const unsigned char *) curve->name, strlen(curve->name)); buf_put_ecc_raw_pubkey_string(buf, key); } -- cgit v1.2.3