diff ecdsa.c @ 1105:c339657c9758

Turn local key_indent variable into char *
author Gaël PORTAY <gael.portay@gmail.com>
date Sat, 02 May 2015 22:24:02 +0200
parents 063c38ea622b
children 4f3335bba3d9
line wrap: on
line diff
--- a/ecdsa.c	Sat May 02 16:30:59 2015 +0200
+++ b/ecdsa.c	Sat May 02 22:24:02 2015 +0200
@@ -140,11 +140,11 @@
 
 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 @@
 	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 @@
 		}
 	}
 
-	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);