summaryrefslogtreecommitdiffhomepage
path: root/ecdsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'ecdsa.c')
-rw-r--r--ecdsa.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ecdsa.c b/ecdsa.c
index 4fee796..5568131 100644
--- a/ecdsa.c
+++ b/ecdsa.c
@@ -83,9 +83,9 @@ ecc_key *buf_get_ecdsa_pub_key(buffer* buf) {
ecc_key *new_key = NULL;
/* string "ecdsa-sha2-[identifier]" */
- key_ident = buf_getstring(buf, &key_ident_len);
+ key_ident = (unsigned char*)buf_getstring(buf, &key_ident_len);
/* string "[identifier]" */
- identifier = buf_getstring(buf, &identifier_len);
+ identifier = (unsigned char*)buf_getstring(buf, &identifier_len);
if (key_ident_len != identifier_len + strlen("ecdsa-sha2-")) {
TRACE(("Bad identifier lengths"))
@@ -140,10 +140,10 @@ 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);
+ snprintf(key_ident, sizeof(key_ident), "ecdsa-sha2-%s", curve->name);
buf_putstring(buf, 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,7 +222,7 @@ 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);
+ snprintf(key_ident, sizeof(key_ident), "ecdsa-sha2-%s", curve->name);
buf_putstring(buf, key_ident, strlen(key_ident));
/* enough for nistp521 */
sigbuf = buf_new(200);