From 9e0ddd4379242d325157e38d406e5ed80ba0892c Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Tue, 18 Sep 2001 05:41:19 +0000 Subject: [PATCH] - stevesk@cvs.openbsd.org 2001/09/17 19:27:15 [kexdh.c kexgex.c key.c key.h ssh-dss.c ssh-keygen.c ssh-rsa.c] u_char*/char* cleanup; ok markus --- ChangeLog | 5 ++++- kexdh.c | 14 +++++++------- kexgex.c | 12 ++++++------ key.c | 4 ++-- key.h | 4 ++-- ssh-dss.c | 6 +++--- ssh-keygen.c | 6 +++--- ssh-rsa.c | 6 +++--- 8 files changed, 30 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3c0cb6afc..d00aaadab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,9 @@ - stevesk@cvs.openbsd.org 2001/09/17 17:57:57 [scp.1 scp.c sftp.1 sftp.c] add -Fssh_config option; ok markus@ + - stevesk@cvs.openbsd.org 2001/09/17 19:27:15 + [kexdh.c kexgex.c key.c key.h ssh-dss.c ssh-keygen.c ssh-rsa.c] + u_char*/char* cleanup; ok markus 20010917 - (djm) x11-ssh-askpass-1.2.4 in RPM spec, revert workarounds @@ -6472,4 +6475,4 @@ - Wrote replacements for strlcpy and mkdtemp - Released 1.0pre1 -$Id: ChangeLog,v 1.1532 2001/09/18 05:38:44 mouring Exp $ +$Id: ChangeLog,v 1.1533 2001/09/18 05:41:19 mouring Exp $ diff --git a/kexdh.c b/kexdh.c index 3e96a1ab3..b850a1a22 100644 --- a/kexdh.c +++ b/kexdh.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: kexdh.c,v 1.6 2001/06/23 15:12:18 itojun Exp $"); +RCSID("$OpenBSD: kexdh.c,v 1.7 2001/09/17 19:27:15 stevesk Exp $"); #include #include @@ -44,7 +44,7 @@ kex_dh_hash( char *server_version_string, char *ckexinit, int ckexinitlen, char *skexinit, int skexinitlen, - char *serverhostkeyblob, int sbloblen, + u_char *serverhostkeyblob, int sbloblen, BIGNUM *client_dh_pub, BIGNUM *server_dh_pub, BIGNUM *shared_secret) @@ -94,7 +94,7 @@ kexdh_client(Kex *kex) BIGNUM *dh_server_pub = NULL, *shared_secret = NULL; DH *dh; Key *server_host_key; - char *server_host_key_blob = NULL, *signature = NULL; + u_char *server_host_key_blob = NULL, *signature = NULL; u_char *kbuf, *hash; u_int klen, kout, slen, sbloblen; int dlen, plen; @@ -174,7 +174,7 @@ kexdh_client(Kex *kex) BN_free(dh_server_pub); DH_free(dh); - if (key_verify(server_host_key, (u_char *)signature, slen, hash, 20) != 1) + if (key_verify(server_host_key, signature, slen, hash, 20) != 1) fatal("key_verify failed for server_host_key"); key_free(server_host_key); xfree(signature); @@ -257,7 +257,7 @@ kexdh_server(Kex *kex) kex->server_version_string, buffer_ptr(&kex->peer), buffer_len(&kex->peer), buffer_ptr(&kex->my), buffer_len(&kex->my), - (char *)server_host_key_blob, sbloblen, + server_host_key_blob, sbloblen, dh_client_pub, dh->pub_key, shared_secret @@ -280,9 +280,9 @@ kexdh_server(Kex *kex) /* send server hostkey, DH pubkey 'f' and singed H */ packet_start(SSH2_MSG_KEXDH_REPLY); - packet_put_string((char *)server_host_key_blob, sbloblen); + packet_put_string(server_host_key_blob, sbloblen); packet_put_bignum2(dh->pub_key); /* f */ - packet_put_string((char *)signature, slen); + packet_put_string(signature, slen); packet_send(); xfree(signature); diff --git a/kexgex.c b/kexgex.c index 1bc6b7e15..f06f2c355 100644 --- a/kexgex.c +++ b/kexgex.c @@ -24,7 +24,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: kexgex.c,v 1.8 2001/06/23 15:12:19 itojun Exp $"); +RCSID("$OpenBSD: kexgex.c,v 1.9 2001/09/17 19:27:15 stevesk Exp $"); #include @@ -45,7 +45,7 @@ kexgex_hash( char *server_version_string, char *ckexinit, int ckexinitlen, char *skexinit, int skexinitlen, - char *serverhostkeyblob, int sbloblen, + u_char *serverhostkeyblob, int sbloblen, int min, int wantbits, int max, BIGNUM *prime, BIGNUM *gen, BIGNUM *client_dh_pub, BIGNUM *server_dh_pub, @@ -234,7 +234,7 @@ kexgex_client(Kex *kex) xfree(server_host_key_blob); BN_free(dh_server_pub); - if (key_verify(server_host_key, (u_char *)signature, slen, hash, 20) != 1) + if (key_verify(server_host_key, signature, slen, hash, 20) != 1) fatal("key_verify failed for server_host_key"); key_free(server_host_key); xfree(signature); @@ -358,7 +358,7 @@ kexgex_server(Kex *kex) kex->server_version_string, buffer_ptr(&kex->peer), buffer_len(&kex->peer), buffer_ptr(&kex->my), buffer_len(&kex->my), - (char *)server_host_key_blob, sbloblen, + server_host_key_blob, sbloblen, min, nbits, max, dh->p, dh->g, dh_client_pub, @@ -384,9 +384,9 @@ kexgex_server(Kex *kex) /* send server hostkey, DH pubkey 'f' and singed H */ debug("SSH2_MSG_KEX_DH_GEX_REPLY sent"); packet_start(SSH2_MSG_KEX_DH_GEX_REPLY); - packet_put_string((char *)server_host_key_blob, sbloblen); + packet_put_string(server_host_key_blob, sbloblen); packet_put_bignum2(dh->pub_key); /* f */ - packet_put_string((char *)signature, slen); + packet_put_string(signature, slen); packet_send(); xfree(signature); xfree(server_host_key_blob); diff --git a/key.c b/key.c index 0ddd3d9d4..482168de0 100644 --- a/key.c +++ b/key.c @@ -32,7 +32,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: key.c,v 1.29 2001/06/26 20:14:10 markus Exp $"); +RCSID("$OpenBSD: key.c,v 1.30 2001/09/17 19:27:15 stevesk Exp $"); #include @@ -653,7 +653,7 @@ key_names_valid2(const char *names) } Key * -key_from_blob(char *blob, int blen) +key_from_blob(u_char *blob, int blen) { Buffer b; char *ktype; diff --git a/key.h b/key.h index 2b4fbce04..00eebb7f1 100644 --- a/key.h +++ b/key.h @@ -1,4 +1,4 @@ -/* $OpenBSD: key.h,v 1.16 2001/06/26 20:14:10 markus Exp $ */ +/* $OpenBSD: key.h,v 1.17 2001/09/17 19:27:15 stevesk Exp $ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. @@ -69,7 +69,7 @@ Key *key_generate(int, u_int); Key *key_from_private(Key *); int key_type_from_name(char *); -Key *key_from_blob(char *, int); +Key *key_from_blob(u_char *, int); int key_to_blob(Key *, u_char **, u_int *); char *key_ssh_name(Key *); int key_names_valid2(const char *); diff --git a/ssh-dss.c b/ssh-dss.c index 5cf007667..22fffa02a 100644 --- a/ssh-dss.c +++ b/ssh-dss.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-dss.c,v 1.7 2001/06/06 23:13:54 markus Exp $"); +RCSID("$OpenBSD: ssh-dss.c,v 1.8 2001/09/17 19:27:15 stevesk Exp $"); #include #include @@ -133,14 +133,14 @@ ssh_dss_verify( /* ietf-drafts */ char *ktype; buffer_init(&b); - buffer_append(&b, (char *) signature, signaturelen); + buffer_append(&b, signature, signaturelen); ktype = buffer_get_string(&b, NULL); if (strcmp("ssh-dss", ktype) != 0) { error("ssh_dss_verify: cannot handle type %s", ktype); buffer_free(&b); return -1; } - sigblob = (u_char *)buffer_get_string(&b, &len); + sigblob = buffer_get_string(&b, &len); rlen = buffer_len(&b); if(rlen != 0) { error("remaining bytes in signature %d", rlen); diff --git a/ssh-keygen.c b/ssh-keygen.c index cd1674b04..db4fef2fe 100644 --- a/ssh-keygen.c +++ b/ssh-keygen.c @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-keygen.c,v 1.79 2001/08/02 16:14:05 jakob Exp $"); +RCSID("$OpenBSD: ssh-keygen.c,v 1.80 2001/09/17 19:27:15 stevesk Exp $"); #include #include @@ -190,7 +190,7 @@ buffer_get_bignum_bits(Buffer *b, BIGNUM *value) } static Key * -do_convert_private_ssh2_from_blob(char *blob, int blen) +do_convert_private_ssh2_from_blob(u_char *blob, int blen) { Buffer b; Key *key = NULL; @@ -287,7 +287,7 @@ do_convert_from_ssh2(struct passwd *pw) Key *k; int blen; char line[1024], *p; - char blob[8096]; + u_char blob[8096]; char encoded[8096]; struct stat st; int escaped = 0, private = 0, ok; diff --git a/ssh-rsa.c b/ssh-rsa.c index a4ab3c516..15ce5e977 100644 --- a/ssh-rsa.c +++ b/ssh-rsa.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-rsa.c,v 1.9 2001/06/06 23:13:54 markus Exp $"); +RCSID("$OpenBSD: ssh-rsa.c,v 1.10 2001/09/17 19:27:15 stevesk Exp $"); #include #include @@ -130,7 +130,7 @@ ssh_rsa_verify( return -1; } buffer_init(&b); - buffer_append(&b, (char *) signature, signaturelen); + buffer_append(&b, signature, signaturelen); ktype = buffer_get_string(&b, NULL); if (strcmp("ssh-rsa", ktype) != 0) { error("ssh_rsa_verify: cannot handle type %s", ktype); @@ -139,7 +139,7 @@ ssh_rsa_verify( return -1; } xfree(ktype); - sigblob = (u_char *)buffer_get_string(&b, &len); + sigblob = buffer_get_string(&b, &len); rlen = buffer_len(&b); buffer_free(&b); if(rlen != 0) {