]> andersk Git - openssh.git/commitdiff
- jakob@cvs.openbsd.org 2003/11/10 16:23:41
authordjm <djm>
Mon, 17 Nov 2003 10:18:23 +0000 (10:18 +0000)
committerdjm <djm>
Mon, 17 Nov 2003 10:18:23 +0000 (10:18 +0000)
     [bufaux.c bufaux.h cipher.c cipher.h hostfile.c hostfile.h key.c]
     [key.h sftp-common.c sftp-common.h sftp-server.c sshconnect.c sshd.c]
     [ssh-dss.c ssh-rsa.c uuencode.c uuencode.h]
     constify. ok markus@ & djm@

18 files changed:
ChangeLog
bufaux.c
bufaux.h
cipher.c
cipher.h
hostfile.c
hostfile.h
key.c
key.h
sftp-common.c
sftp-common.h
sftp-server.c
ssh-dss.c
ssh-rsa.c
sshconnect.c
sshd.c
uuencode.c
uuencode.h

index 4108d36e54f193994b8f7dc2c6cb9537ef1e7631..3b2d12bf13a01e95d949cf8a8cbedbd2725cf4c8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
    - jmc@cvs.openbsd.org 2003/11/08 19:17:29
      [sftp-int.c]
      typos from Jonathon Gray;
+   - jakob@cvs.openbsd.org 2003/11/10 16:23:41
+     [bufaux.c bufaux.h cipher.c cipher.h hostfile.c hostfile.h key.c]
+     [key.h sftp-common.c sftp-common.h sftp-server.c sshconnect.c sshd.c]
+     [ssh-dss.c ssh-rsa.c uuencode.c uuencode.h]
+     constify. ok markus@ & djm@
 
 20031115
  - (dtucker) [regress/agent-ptrace.sh] Test for GDB output from Solaris and
index 1df15b5483532233e87387088e036ab52864fd26..339d744355c2e18a93ec6d31072907b39f268c4e 100644 (file)
--- a/bufaux.c
+++ b/bufaux.c
@@ -37,7 +37,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: bufaux.c,v 1.30 2003/09/18 13:02:21 miod Exp $");
+RCSID("$OpenBSD: bufaux.c,v 1.31 2003/11/10 16:23:41 jakob Exp $");
 
 #include <openssl/bn.h>
 #include "bufaux.h"
@@ -50,7 +50,7 @@ RCSID("$OpenBSD: bufaux.c,v 1.30 2003/09/18 13:02:21 miod Exp $");
  * by (bits+7)/8 bytes of binary data, msb first.
  */
 void
-buffer_put_bignum(Buffer *buffer, BIGNUM *value)
+buffer_put_bignum(Buffer *buffer, const BIGNUM *value)
 {
        int bits = BN_num_bits(value);
        int bin_size = (bits + 7) / 8;
@@ -101,7 +101,7 @@ buffer_get_bignum(Buffer *buffer, BIGNUM *value)
  * Stores an BIGNUM in the buffer in SSH2 format.
  */
 void
-buffer_put_bignum2(Buffer *buffer, BIGNUM *value)
+buffer_put_bignum2(Buffer *buffer, const BIGNUM *value)
 {
        u_int bytes = BN_num_bytes(value) + 1;
        u_char *buf = xmalloc(bytes);
index 935553579422f7534d6b71e0f49c428c7b18b612..61c72e353793defc2515352652ce9a278660b057 100644 (file)
--- a/bufaux.h
+++ b/bufaux.h
@@ -1,4 +1,4 @@
-/*     $OpenBSD: bufaux.h,v 1.18 2002/04/20 09:14:58 markus Exp $      */
+/*     $OpenBSD: bufaux.h,v 1.19 2003/11/10 16:23:41 jakob Exp $       */
 
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -18,8 +18,8 @@
 #include "buffer.h"
 #include <openssl/bn.h>
 
-void    buffer_put_bignum(Buffer *, BIGNUM *);
-void    buffer_put_bignum2(Buffer *, BIGNUM *);
+void    buffer_put_bignum(Buffer *, const BIGNUM *);
+void    buffer_put_bignum2(Buffer *, const BIGNUM *);
 void   buffer_get_bignum(Buffer *, BIGNUM *);
 void   buffer_get_bignum2(Buffer *, BIGNUM *);
 
index ce533670b85a10220eb2b52f0625942ed9f3adc7..a1c40cc4a3da65a6f3a9a1d84d416b5480707646 100644 (file)
--- a/cipher.c
+++ b/cipher.c
@@ -35,7 +35,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: cipher.c,v 1.65 2003/05/17 04:27:52 markus Exp $");
+RCSID("$OpenBSD: cipher.c,v 1.66 2003/11/10 16:23:41 jakob Exp $");
 
 #include "xmalloc.h"
 #include "log.h"
@@ -99,19 +99,19 @@ struct Cipher {
 /*--*/
 
 u_int
-cipher_blocksize(Cipher *c)
+cipher_blocksize(const Cipher *c)
 {
        return (c->block_size);
 }
 
 u_int
-cipher_keylen(Cipher *c)
+cipher_keylen(const Cipher *c)
 {
        return (c->key_len);
 }
 
 u_int
-cipher_get_number(Cipher *c)
+cipher_get_number(const Cipher *c)
 {
        return (c->number);
 }
@@ -311,7 +311,7 @@ cipher_set_key_string(CipherContext *cc, Cipher *cipher,
  */
 
 int
-cipher_get_keyiv_len(CipherContext *cc)
+cipher_get_keyiv_len(const CipherContext *cc)
 {
        Cipher *c = cc->cipher;
        int ivlen;
@@ -397,7 +397,7 @@ cipher_set_keyiv(CipherContext *cc, u_char *iv)
 #endif
 
 int
-cipher_get_keycontext(CipherContext *cc, u_char *dat)
+cipher_get_keycontext(const CipherContext *cc, u_char *dat)
 {
        Cipher *c = cc->cipher;
        int plen = 0;
index fc7f6dd0fc46b3301938626c3a2b6d319313e28d..74b3669fd08a66aa4e3037b8caba31cb27c20fce 100644 (file)
--- a/cipher.h
+++ b/cipher.h
@@ -1,4 +1,4 @@
-/*     $OpenBSD: cipher.h,v 1.33 2002/03/18 17:13:15 markus Exp $      */
+/*     $OpenBSD: cipher.h,v 1.34 2003/11/10 16:23:41 jakob Exp $       */
 
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -79,13 +79,13 @@ void         cipher_init(CipherContext *, Cipher *, const u_char *, u_int,
 void    cipher_crypt(CipherContext *, u_char *, const u_char *, u_int);
 void    cipher_cleanup(CipherContext *);
 void    cipher_set_key_string(CipherContext *, Cipher *, const char *, int);
-u_int   cipher_blocksize(Cipher *);
-u_int   cipher_keylen(Cipher *);
+u_int   cipher_blocksize(const Cipher *);
+u_int   cipher_keylen(const Cipher *);
 
-u_int   cipher_get_number(Cipher *);
+u_int   cipher_get_number(const Cipher *);
 void    cipher_get_keyiv(CipherContext *, u_char *, u_int);
 void    cipher_set_keyiv(CipherContext *, u_char *);
-int     cipher_get_keyiv_len(CipherContext *);
-int     cipher_get_keycontext(CipherContext *, u_char *);
+int     cipher_get_keyiv_len(const CipherContext *);
+int     cipher_get_keycontext(const CipherContext *, u_char *);
 void    cipher_set_keycontext(CipherContext *, u_char *);
 #endif                         /* CIPHER_H */
index 42a8aa71dae6d844ab22df57fc1bdc71b4296269..88c0549127820632de8a3b351468cb89a9de00aa 100644 (file)
@@ -36,7 +36,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: hostfile.c,v 1.31 2003/04/08 20:21:28 itojun Exp $");
+RCSID("$OpenBSD: hostfile.c,v 1.32 2003/11/10 16:23:41 jakob Exp $");
 
 #include "packet.h"
 #include "match.h"
@@ -72,7 +72,7 @@ hostfile_read_key(char **cpp, u_int *bitsp, Key *ret)
 }
 
 static int
-hostfile_check_key(int bits, Key *key, const char *host, const char *filename, int linenum)
+hostfile_check_key(int bits, const Key *key, const char *host, const char *filename, int linenum)
 {
        if (key == NULL || key->type != KEY_RSA1 || key->rsa == NULL)
                return 1;
@@ -98,7 +98,7 @@ hostfile_check_key(int bits, Key *key, const char *host, const char *filename, i
 
 static HostStatus
 check_host_in_hostfile_by_key_or_type(const char *filename,
-    const char *host, Key *key, int keytype, Key *found, int *numret)
+    const char *host, const Key *key, int keytype, Key *found, int *numret)
 {
        FILE *f;
        char line[8192];
@@ -188,7 +188,7 @@ check_host_in_hostfile_by_key_or_type(const char *filename,
 }
 
 HostStatus
-check_host_in_hostfile(const char *filename, const char *host, Key *key,
+check_host_in_hostfile(const char *filename, const char *host, const Key *key,
     Key *found, int *numret)
 {
        if (key == NULL)
@@ -211,7 +211,7 @@ lookup_key_in_hostfile_by_type(const char *filename, const char *host,
  */
 
 int
-add_host_to_hostfile(const char *filename, const char *host, Key *key)
+add_host_to_hostfile(const char *filename, const char *host, const Key *key)
 {
        FILE *f;
        int success = 0;
index e3d1165818cbc236710ad6104b44ce1f7f723c58..efcddc9f9c0e6a0bb10417c4a03e27662dacd8ed 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: hostfile.h,v 1.13 2002/11/21 23:03:51 deraadt Exp $   */
+/*     $OpenBSD: hostfile.h,v 1.14 2003/11/10 16:23:41 jakob Exp $     */
 
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -20,8 +20,8 @@ typedef enum {
 
 int     hostfile_read_key(char **, u_int *, Key *);
 HostStatus check_host_in_hostfile(const char *, const char *,
-           Key *, Key *, int *);
-int    add_host_to_hostfile(const char *, const char *, Key *);
+           const Key *, Key *, int *);
+int    add_host_to_hostfile(const char *, const char *, const Key *);
 int    lookup_key_in_hostfile_by_type(const char *, const char *,
            int, Key *, int *);
 
diff --git a/key.c b/key.c
index 54318cbbfa438f42f2081c4abcdf1f84ed645314..323e6ff84bfddeee1a2ca2228c389db6a6d5feda 100644 (file)
--- 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.54 2003/07/09 13:58:19 avsm Exp $");
+RCSID("$OpenBSD: key.c,v 1.55 2003/11/10 16:23:41 jakob Exp $");
 
 #include <openssl/evp.h>
 
@@ -143,8 +143,9 @@ key_free(Key *k)
        }
        xfree(k);
 }
+
 int
-key_equal(Key *a, Key *b)
+key_equal(const Key *a, const Key *b)
 {
        if (a == NULL || b == NULL || a->type != b->type)
                return 0;
@@ -170,7 +171,8 @@ key_equal(Key *a, Key *b)
 }
 
 u_char*
-key_fingerprint_raw(Key *k, enum fp_type dgst_type, u_int *dgst_raw_length)
+key_fingerprint_raw(const Key *k, enum fp_type dgst_type,
+    u_int *dgst_raw_length)
 {
        const EVP_MD *md = NULL;
        EVP_MD_CTX ctx;
@@ -292,7 +294,7 @@ key_fingerprint_bubblebabble(u_char *dgst_raw, u_int dgst_raw_len)
 }
 
 char *
-key_fingerprint(Key *k, enum fp_type dgst_type, enum fp_rep dgst_rep)
+key_fingerprint(const Key *k, enum fp_type dgst_type, enum fp_rep dgst_rep)
 {
        char *retval = NULL;
        u_char *dgst_raw;
@@ -490,7 +492,7 @@ key_read(Key *ret, char **cpp)
 }
 
 int
-key_write(Key *key, FILE *f)
+key_write(const Key *key, FILE *f)
 {
        int n, success = 0;
        u_int len, bits = 0;
@@ -522,8 +524,8 @@ key_write(Key *key, FILE *f)
        return success;
 }
 
-char *
-key_type(Key *k)
+const char *
+key_type(const Key *k)
 {
        switch (k->type) {
        case KEY_RSA1:
@@ -539,8 +541,8 @@ key_type(Key *k)
        return "unknown";
 }
 
-char *
-key_ssh_name(Key *k)
+const char *
+key_ssh_name(const Key *k)
 {
        switch (k->type) {
        case KEY_RSA:
@@ -554,7 +556,7 @@ key_ssh_name(Key *k)
 }
 
 u_int
-key_size(Key *k)
+key_size(const Key *k)
 {
        switch (k->type) {
        case KEY_RSA1:
@@ -611,7 +613,7 @@ key_generate(int type, u_int bits)
 }
 
 Key *
-key_from_private(Key *k)
+key_from_private(const Key *k)
 {
        Key *n = NULL;
        switch (k->type) {
@@ -676,7 +678,7 @@ key_names_valid2(const char *names)
 }
 
 Key *
-key_from_blob(u_char *blob, u_int blen)
+key_from_blob(const u_char *blob, u_int blen)
 {
        Buffer b;
        char *ktype;
@@ -726,7 +728,7 @@ key_from_blob(u_char *blob, u_int blen)
 }
 
 int
-key_to_blob(Key *key, u_char **blobp, u_int *lenp)
+key_to_blob(const Key *key, u_char **blobp, u_int *lenp)
 {
        Buffer b;
        int len;
@@ -768,9 +770,9 @@ key_to_blob(Key *key, u_char **blobp, u_int *lenp)
 
 int
 key_sign(
-    Key *key,
+    const Key *key,
     u_char **sigp, u_int *lenp,
-    u_char *data, u_int datalen)
+    const u_char *data, u_int datalen)
 {
        switch (key->type) {
        case KEY_DSA:
@@ -792,9 +794,9 @@ key_sign(
  */
 int
 key_verify(
-    Key *key,
-    u_char *signature, u_int signaturelen,
-    u_char *data, u_int datalen)
+    const Key *key,
+    const u_char *signature, u_int signaturelen,
+    const u_char *data, u_int datalen)
 {
        if (signaturelen == 0)
                return -1;
@@ -815,7 +817,7 @@ key_verify(
 
 /* Converts a private to a public key */
 Key *
-key_demote(Key *k)
+key_demote(const Key *k)
 {
        Key *pk;
 
diff --git a/key.h b/key.h
index 28753fdfa6afe0dae773fb4404ebe1a2d1c47ad3..50df8500bb99a4f6b7ddd420654711d2e5966f7a 100644 (file)
--- a/key.h
+++ b/key.h
@@ -1,4 +1,4 @@
-/*     $OpenBSD: key.h,v 1.22 2003/06/24 08:23:46 markus Exp $ */
+/*     $OpenBSD: key.h,v 1.23 2003/11/10 16:23:41 jakob Exp $  */
 
 /*
  * Copyright (c) 2000, 2001 Markus Friedl.  All rights reserved.
@@ -55,33 +55,33 @@ struct Key {
        DSA     *dsa;
 };
 
-Key    *key_new(int);
-Key    *key_new_private(int);
-void    key_free(Key *);
-Key    *key_demote(Key *);
-int     key_equal(Key *, Key *);
-char   *key_fingerprint(Key *, enum fp_type, enum fp_rep);
-u_char *key_fingerprint_raw(Key *, enum fp_type, u_int *);
-char   *key_type(Key *);
-int     key_write(Key *, FILE *);
-int     key_read(Key *, char **);
-u_int   key_size(Key *);
+Key            *key_new(int);
+Key            *key_new_private(int);
+void            key_free(Key *);
+Key            *key_demote(const Key *);
+int             key_equal(const Key *, const Key *);
+char           *key_fingerprint(const Key *, enum fp_type, enum fp_rep);
+u_char         *key_fingerprint_raw(const Key *, enum fp_type, u_int *);
+const char     *key_type(const Key *);
+int             key_write(const Key *, FILE *);
+int             key_read(Key *, char **);
+u_int           key_size(const Key *);
 
 Key    *key_generate(int, u_int);
-Key    *key_from_private(Key *);
+Key    *key_from_private(const Key *);
 int     key_type_from_name(char *);
 
-Key    *key_from_blob(u_char *, u_int);
-int     key_to_blob(Key *, u_char **, u_int *);
-char   *key_ssh_name(Key *);
-int     key_names_valid2(const char *);
+Key            *key_from_blob(const u_char *, u_int);
+int             key_to_blob(const Key *, u_char **, u_int *);
+const char     *key_ssh_name(const Key *);
+int             key_names_valid2(const char *);
 
-int     key_sign(Key *, u_char **, u_int *, u_char *, u_int);
-int     key_verify(Key *, u_char *, u_int, u_char *, u_int);
+int     key_sign(const Key *, u_char **, u_int *, const u_char *, u_int);
+int     key_verify(const Key *, const u_char *, u_int, const u_char *, u_int);
 
-int     ssh_dss_sign(Key *, u_char **, u_int *, u_char *, u_int);
-int     ssh_dss_verify(Key *, u_char *, u_int, u_char *, u_int);
-int     ssh_rsa_sign(Key *, u_char **, u_int *, u_char *, u_int);
-int     ssh_rsa_verify(Key *, u_char *, u_int, u_char *, u_int);
+int     ssh_dss_sign(const Key *, u_char **, u_int *, const u_char *, u_int);
+int     ssh_dss_verify(const Key *, const u_char *, u_int, const u_char *, u_int);
+int     ssh_rsa_sign(const Key *, u_char **, u_int *, const u_char *, u_int);
+int     ssh_rsa_verify(const Key *, const u_char *, u_int, const u_char *, u_int);
 
 #endif
index 5313b134dc4710ef9e3cc051de7bef0cc93d86b4..4cea3c3056a41ca909f3d2334ddaf1b7309cd9f6 100644 (file)
@@ -24,7 +24,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sftp-common.c,v 1.9 2003/05/24 09:30:40 djm Exp $");
+RCSID("$OpenBSD: sftp-common.c,v 1.10 2003/11/10 16:23:41 jakob Exp $");
 
 #include "buffer.h"
 #include "bufaux.h"
@@ -49,7 +49,7 @@ attrib_clear(Attrib *a)
 
 /* Convert from struct stat to filexfer attribs */
 void
-stat_to_attrib(struct stat *st, Attrib *a)
+stat_to_attrib(const struct stat *st, Attrib *a)
 {
        attrib_clear(a);
        a->flags = 0;
@@ -67,7 +67,7 @@ stat_to_attrib(struct stat *st, Attrib *a)
 
 /* Convert from filexfer attribs to struct stat */
 void
-attrib_to_stat(Attrib *a, struct stat *st)
+attrib_to_stat(const Attrib *a, struct stat *st)
 {
        memset(st, 0, sizeof(*st));
 
@@ -124,7 +124,7 @@ decode_attrib(Buffer *b)
 
 /* Encode attributes to buffer */
 void
-encode_attrib(Buffer *b, Attrib *a)
+encode_attrib(Buffer *b, const Attrib *a)
 {
        buffer_put_int(b, a->flags);
        if (a->flags & SSH2_FILEXFER_ATTR_SIZE)
@@ -174,7 +174,7 @@ fx2txt(int status)
  * drwxr-xr-x    5 markus   markus       1024 Jan 13 18:39 .ssh
  */
 char *
-ls_file(char *name, struct stat *st, int remote)
+ls_file(const char *name, const struct stat *st, int remote)
 {
        int ulen, glen, sz = 0;
        struct passwd *pw;
index 201611cc4bcbf8052e96332b701d531c3caa806b..b42ba91409f8fc2497b5b76201fddcf91876a127 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: sftp-common.h,v 1.4 2002/09/11 22:41:50 djm Exp $     */
+/*     $OpenBSD: sftp-common.h,v 1.5 2003/11/10 16:23:41 jakob Exp $   */
 
 /*
  * Copyright (c) 2001 Markus Friedl.  All rights reserved.
@@ -39,10 +39,10 @@ struct Attrib {
 };
 
 void    attrib_clear(Attrib *);
-void    stat_to_attrib(struct stat *, Attrib *);
-void    attrib_to_stat(Attrib *, struct stat *);
+void    stat_to_attrib(const struct stat *, Attrib *);
+void    attrib_to_stat(const Attrib *, struct stat *);
 Attrib *decode_attrib(Buffer *);
-void    encode_attrib(Buffer *, Attrib *);
-char   *ls_file(char *, struct stat *, int);
+void    encode_attrib(Buffer *, const Attrib *);
+char   *ls_file(const char *, const struct stat *, int);
 
 const char *fx2txt(int);
index 9166853ed7fb143174b3fc0cc6621aae3ebe4de8..d528a1d6e6662f6f3b523f96334cb2ef37a4d48d 100644 (file)
@@ -22,7 +22,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "includes.h"
-RCSID("$OpenBSD: sftp-server.c,v 1.43 2003/06/25 22:39:36 miod Exp $");
+RCSID("$OpenBSD: sftp-server.c,v 1.44 2003/11/10 16:23:41 jakob Exp $");
 
 #include "buffer.h"
 #include "bufaux.h"
@@ -149,7 +149,7 @@ handle_init(void)
 }
 
 static int
-handle_new(int use, char *name, int fd, DIR *dirp)
+handle_new(int use, const char *name, int fd, DIR *dirp)
 {
        int i;
 
@@ -184,7 +184,7 @@ handle_to_string(int handle, char **stringp, int *hlenp)
 }
 
 static int
-handle_from_string(char *handle, u_int hlen)
+handle_from_string(const char *handle, u_int hlen)
 {
        int val;
 
@@ -298,7 +298,7 @@ send_status(u_int32_t id, u_int32_t error)
        buffer_free(&msg);
 }
 static void
-send_data_or_handle(char type, u_int32_t id, char *data, int dlen)
+send_data_or_handle(char type, u_int32_t id, const char *data, int dlen)
 {
        Buffer msg;
 
@@ -311,7 +311,7 @@ send_data_or_handle(char type, u_int32_t id, char *data, int dlen)
 }
 
 static void
-send_data(u_int32_t id, char *data, int dlen)
+send_data(u_int32_t id, const char *data, int dlen)
 {
        TRACE("sent data id %u len %d", id, dlen);
        send_data_or_handle(SSH2_FXP_DATA, id, data, dlen);
@@ -330,7 +330,7 @@ send_handle(u_int32_t id, int handle)
 }
 
 static void
-send_names(u_int32_t id, int count, Stat *stats)
+send_names(u_int32_t id, int count, const Stat *stats)
 {
        Buffer msg;
        int i;
@@ -350,7 +350,7 @@ send_names(u_int32_t id, int count, Stat *stats)
 }
 
 static void
-send_attrib(u_int32_t id, Attrib *a)
+send_attrib(u_int32_t id, const Attrib *a)
 {
        Buffer msg;
 
@@ -567,7 +567,7 @@ process_fstat(void)
 }
 
 static struct timeval *
-attrib_to_tv(Attrib *a)
+attrib_to_tv(const Attrib *a)
 {
        static struct timeval tv[2];
 
index 6cedcc4dcd74893f7936cfdb97d5ae322e02e2e8..381b7dedb055818c95f0c3ca125c875c1082924c 100644 (file)
--- a/ssh-dss.c
+++ b/ssh-dss.c
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: ssh-dss.c,v 1.18 2003/02/12 09:33:04 markus Exp $");
+RCSID("$OpenBSD: ssh-dss.c,v 1.19 2003/11/10 16:23:41 jakob Exp $");
 
 #include <openssl/bn.h>
 #include <openssl/evp.h>
@@ -39,8 +39,8 @@ RCSID("$OpenBSD: ssh-dss.c,v 1.18 2003/02/12 09:33:04 markus Exp $");
 #define SIGBLOB_LEN    (2*INTBLOB_LEN)
 
 int
-ssh_dss_sign(Key *key, u_char **sigp, u_int *lenp,
-    u_char *data, u_int datalen)
+ssh_dss_sign(const Key *key, u_char **sigp, u_int *lenp,
+    const u_char *data, u_int datalen)
 {
        DSA_SIG *sig;
        const EVP_MD *evp_md = EVP_sha1();
@@ -101,8 +101,8 @@ ssh_dss_sign(Key *key, u_char **sigp, u_int *lenp,
        return 0;
 }
 int
-ssh_dss_verify(Key *key, u_char *signature, u_int signaturelen,
-    u_char *data, u_int datalen)
+ssh_dss_verify(const Key *key, const u_char *signature, u_int signaturelen,
+    const u_char *data, u_int datalen)
 {
        DSA_SIG *sig;
        const EVP_MD *evp_md = EVP_sha1();
@@ -119,7 +119,8 @@ ssh_dss_verify(Key *key, u_char *signature, u_int signaturelen,
 
        /* fetch signature */
        if (datafellows & SSH_BUG_SIGBLOB) {
-               sigblob = signature;
+               sigblob = xmalloc(signaturelen);
+               memcpy(sigblob, signature, signaturelen);
                len = signaturelen;
        } else {
                /* ietf-drafts */
@@ -159,10 +160,9 @@ ssh_dss_verify(Key *key, u_char *signature, u_int signaturelen,
        BN_bin2bn(sigblob, INTBLOB_LEN, sig->r);
        BN_bin2bn(sigblob+ INTBLOB_LEN, INTBLOB_LEN, sig->s);
 
-       if (!(datafellows & SSH_BUG_SIGBLOB)) {
-               memset(sigblob, 0, len);
-               xfree(sigblob);
-       }
+       /* clean up */
+       memset(sigblob, 0, len);
+       xfree(sigblob);
 
        /* sha1 the data */
        EVP_DigestInit(&md, evp_md);
index 53e5023f7495a8ad0c1345d024fe56b93de70801..6e3be0a7ec8029bf8a490cc00e51aa8ebc0c3cf7 100644 (file)
--- a/ssh-rsa.c
+++ b/ssh-rsa.c
@@ -14,7 +14,7 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 #include "includes.h"
-RCSID("$OpenBSD: ssh-rsa.c,v 1.30 2003/06/18 11:28:11 markus Exp $");
+RCSID("$OpenBSD: ssh-rsa.c,v 1.31 2003/11/10 16:23:41 jakob Exp $");
 
 #include <openssl/evp.h>
 #include <openssl/err.h>
@@ -31,8 +31,8 @@ static int openssh_RSA_verify(int, u_char *, u_int, u_char *, u_int, RSA *);
 
 /* RSASSA-PKCS1-v1_5 (PKCS #1 v2.0 signature) with SHA1 */
 int
-ssh_rsa_sign(Key *key, u_char **sigp, u_int *lenp,
-    u_char *data, u_int datalen)
+ssh_rsa_sign(const Key *key, u_char **sigp, u_int *lenp,
+    const u_char *data, u_int datalen)
 {
        const EVP_MD *evp_md;
        EVP_MD_CTX md;
@@ -96,8 +96,8 @@ ssh_rsa_sign(Key *key, u_char **sigp, u_int *lenp,
 }
 
 int
-ssh_rsa_verify(Key *key, u_char *signature, u_int signaturelen,
-    u_char *data, u_int datalen)
+ssh_rsa_verify(const Key *key, const u_char *signature, u_int signaturelen,
+    const u_char *data, u_int datalen)
 {
        Buffer b;
        const EVP_MD *evp_md;
index 55ebd7ef2243ccd6275f32bfe11e8be4f146af3c..bf8c23d739e28d1f9e4250cbe4f16738e2ec6064 100644 (file)
@@ -13,7 +13,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshconnect.c,v 1.151 2003/11/03 09:37:32 jakob Exp $");
+RCSID("$OpenBSD: sshconnect.c,v 1.152 2003/11/10 16:23:41 jakob Exp $");
 
 #include <openssl/bn.h>
 
@@ -563,7 +563,7 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
     int readonly, const char *user_hostfile, const char *system_hostfile)
 {
        Key *file_key;
-       char *type = key_type(host_key);
+       const char *type = key_type(host_key);
        char *ip = NULL;
        char hostline[1000], *hostp, *fp;
        HostStatus host_status;
diff --git a/sshd.c b/sshd.c
index 7d97c92deb9ced0c17df298d0728a3a47c2c7e02..a9001a040a87471bc2d9e976cfdea4ff348781fb 100644 (file)
--- a/sshd.c
+++ b/sshd.c
@@ -42,7 +42,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshd.c,v 1.280 2003/10/02 10:41:59 markus Exp $");
+RCSID("$OpenBSD: sshd.c,v 1.281 2003/11/10 16:23:41 jakob Exp $");
 
 #include <openssl/dh.h>
 #include <openssl/bn.h>
@@ -668,7 +668,8 @@ static char *
 list_hostkey_types(void)
 {
        Buffer b;
-       char *p;
+       const char *p;
+       char *ret;
        int i;
 
        buffer_init(&b);
@@ -687,10 +688,10 @@ list_hostkey_types(void)
                }
        }
        buffer_append(&b, "\0", 1);
-       p = xstrdup(buffer_ptr(&b));
+       ret = xstrdup(buffer_ptr(&b));
        buffer_free(&b);
-       debug("list_hostkey_types: %s", p);
-       return p;
+       debug("list_hostkey_types: %s", ret);
+       return ret;
 }
 
 Key *
index 21eaf4d3f43ee0a333ca5d793234b5b498f93285..0a7c8d16af25ee6d2ad78a1b7b39e79a08ec7211 100644 (file)
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: uuencode.c,v 1.16 2002/09/09 14:54:15 markus Exp $");
+RCSID("$OpenBSD: uuencode.c,v 1.17 2003/11/10 16:23:41 jakob Exp $");
 
 #include "xmalloc.h"
 #include "uuencode.h"
 
 int
-uuencode(u_char *src, u_int srclength,
+uuencode(const u_char *src, u_int srclength,
     char *target, size_t targsize)
 {
        return __b64_ntop(src, srclength, target, targsize);
index 682b623acb814d07263a53334065b2b96931a460..08e87c4bcc6892d48e79895be961d4d913f6e47d 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: uuencode.h,v 1.9 2002/02/25 16:33:27 markus Exp $     */
+/*     $OpenBSD: uuencode.h,v 1.10 2003/11/10 16:23:41 jakob Exp $     */
 
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
@@ -26,7 +26,7 @@
 
 #ifndef UUENCODE_H
 #define UUENCODE_H
-int     uuencode(u_char *, u_int, char *, size_t);
+int     uuencode(const u_char *, u_int, char *, size_t);
 int     uudecode(const char *, u_char *, size_t);
 void    dump_base64(FILE *, u_char *, u_int);
 #endif
This page took 0.138062 seconds and 5 git commands to generate.