]> andersk Git - openssh.git/commitdiff
- deraadt@cvs.openbsd.org 2002/06/23 03:30:58
authormouring <mouring>
Sun, 23 Jun 2002 21:23:20 +0000 (21:23 +0000)
committermouring <mouring>
Sun, 23 Jun 2002 21:23:20 +0000 (21:23 +0000)
     [scard.c ssh-dss.c ssh-rsa.c sshconnect.c sshconnect2.c sshd.c sshlogin.c
      sshpty.c]
     various KNF and %d for unsigned

ChangeLog
scard.c
ssh-dss.c
ssh-rsa.c
sshconnect.c
sshconnect2.c
sshd.c
sshlogin.c
sshpty.c

index be1d15fbe4b70e837f913cffbd6c28b883bb2910..28626f7976606fdb0df79ccf18a9df84b0eef584 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,10 @@
    - deraadt@cvs.openbsd.org 2002/06/23 03:26:19
      [cipher.c key.c]
      KNF
+   - deraadt@cvs.openbsd.org 2002/06/23 03:30:58
+     [scard.c ssh-dss.c ssh-rsa.c sshconnect.c sshconnect2.c sshd.c sshlogin.c
+      sshpty.c]
+     various KNF and %d for unsigned
 
 20020623
  - (stevesk) [configure.ac] bug #255 LOGIN_NEEDS_UTMPX for AIX.
diff --git a/scard.c b/scard.c
index db0cc4a80ca2be4a9d7d17abdeb4e7a2245a8f82..9791938c0b5a36e19a6b6eced90e9696eab523bb 100644 (file)
--- a/scard.c
+++ b/scard.c
@@ -24,7 +24,7 @@
 
 #include "includes.h"
 #if defined(SMARTCARD) && defined(USE_SECTOK)
-RCSID("$OpenBSD: scard.c,v 1.25 2002/03/26 18:46:59 rees Exp $");
+RCSID("$OpenBSD: scard.c,v 1.26 2002/06/23 03:30:17 deraadt Exp $");
 
 #include <openssl/evp.h>
 #include <sectok.h>
@@ -191,7 +191,7 @@ sc_read_pubkey(Key * k)
 
        status = 0;
        p = key_fingerprint(k, SSH_FP_MD5, SSH_FP_HEX);
-       debug("fingerprint %d %s", key_size(k), p);
+       debug("fingerprint %u %s", key_size(k), p);
        xfree(p);
 
 err:
index 02403f550afc22388d6cc9e7f9d3aa31a5128849..dbf8465bae54612d6160c2f7e7fff0f06f4b0d01 100644 (file)
--- a/ssh-dss.c
+++ b/ssh-dss.c
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: ssh-dss.c,v 1.14 2002/02/28 15:46:33 markus Exp $");
+RCSID("$OpenBSD: ssh-dss.c,v 1.15 2002/06/23 03:30:17 deraadt Exp $");
 
 #include <openssl/bn.h>
 #include <openssl/evp.h>
@@ -40,9 +40,7 @@ RCSID("$OpenBSD: ssh-dss.c,v 1.14 2002/02/28 15:46:33 markus Exp $");
 #define SIGBLOB_LEN    (2*INTBLOB_LEN)
 
 int
-ssh_dss_sign(
-    Key *key,
-    u_char **sigp, u_int *lenp,
+ssh_dss_sign(Key *key, u_char **sigp, u_int *lenp,
     u_char *data, u_int datalen)
 {
        DSA_SIG *sig;
@@ -71,7 +69,7 @@ ssh_dss_sign(
        rlen = BN_num_bytes(sig->r);
        slen = BN_num_bytes(sig->s);
        if (rlen > INTBLOB_LEN || slen > INTBLOB_LEN) {
-               error("bad sig size %d %d", rlen, slen);
+               error("bad sig size %u %u", rlen, slen);
                DSA_SIG_free(sig);
                return -1;
        }
@@ -104,9 +102,7 @@ ssh_dss_sign(
        return 0;
 }
 int
-ssh_dss_verify(
-    Key *key,
-    u_char *signature, u_int signaturelen,
+ssh_dss_verify(Key *key, u_char *signature, u_int signaturelen,
     u_char *data, u_int datalen)
 {
        DSA_SIG *sig;
@@ -151,7 +147,7 @@ ssh_dss_verify(
        }
 
        if (len != SIGBLOB_LEN) {
-               fatal("bad sigbloblen %d != SIGBLOB_LEN", len);
+               fatal("bad sigbloblen %u != SIGBLOB_LEN", len);
        }
 
        /* parse signature */
index 3e66294e9f8c4ad939cfb0a8b40e8b5c673f5728..782279bad23b9fae75f22022bdec879cfea7bb0c 100644 (file)
--- a/ssh-rsa.c
+++ b/ssh-rsa.c
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: ssh-rsa.c,v 1.20 2002/06/10 16:53:06 stevesk Exp $");
+RCSID("$OpenBSD: ssh-rsa.c,v 1.21 2002/06/23 03:30:17 deraadt Exp $");
 
 #include <openssl/evp.h>
 #include <openssl/err.h>
@@ -39,9 +39,7 @@ RCSID("$OpenBSD: ssh-rsa.c,v 1.20 2002/06/10 16:53:06 stevesk Exp $");
 
 /* RSASSA-PKCS1-v1_5 (PKCS #1 v2.0 signature) with SHA1 */
 int
-ssh_rsa_sign(
-    Key *key,
-    u_char **sigp, u_int *lenp,
+ssh_rsa_sign(Key *key, u_char **sigp, u_int *lenp,
     u_char *data, u_int datalen)
 {
        const EVP_MD *evp_md;
@@ -72,17 +70,18 @@ ssh_rsa_sign(
 
        if (ok != 1) {
                int ecode = ERR_get_error();
-               error("ssh_rsa_sign: RSA_sign failed: %s", ERR_error_string(ecode, NULL));
+               error("ssh_rsa_sign: RSA_sign failed: %s",
+                   ERR_error_string(ecode, NULL));
                xfree(sig);
                return -1;
        }
        if (len < slen) {
                int diff = slen - len;
-               debug("slen %d > len %d", slen, len);
+               debug("slen %u > len %u", slen, len);
                memmove(sig + diff, sig, len);
                memset(sig, 0, diff);
        } else if (len > slen) {
-               error("ssh_rsa_sign: slen %d slen2 %d", slen, len);
+               error("ssh_rsa_sign: slen %u slen2 %u", slen, len);
                xfree(sig);
                return -1;
        }
@@ -105,9 +104,7 @@ ssh_rsa_sign(
 }
 
 int
-ssh_rsa_verify(
-    Key *key,
-    u_char *signature, u_int signaturelen,
+ssh_rsa_verify(Key *key, u_char *signature, u_int signaturelen,
     u_char *data, u_int datalen)
 {
        Buffer b;
@@ -148,12 +145,12 @@ ssh_rsa_verify(
        /* RSA_verify expects a signature of RSA_size */
        modlen = RSA_size(key->rsa);
        if (len > modlen) {
-               error("ssh_rsa_verify: len %d > modlen %d", len, modlen);
+               error("ssh_rsa_verify: len %u > modlen %u", len, modlen);
                xfree(sigblob);
                return -1;
        } else if (len < modlen) {
                int diff = modlen - len;
-               debug("ssh_rsa_verify: add padding: modlen %d > len %d",
+               debug("ssh_rsa_verify: add padding: modlen %u > len %u",
                    modlen, len);
                sigblob = xrealloc(sigblob, modlen);
                memmove(sigblob + diff, sigblob, len);
@@ -176,7 +173,8 @@ ssh_rsa_verify(
        xfree(sigblob);
        if (ret == 0) {
                int ecode = ERR_get_error();
-               error("ssh_rsa_verify: RSA_verify failed: %s", ERR_error_string(ecode, NULL));
+               error("ssh_rsa_verify: RSA_verify failed: %s",
+                   ERR_error_string(ecode, NULL));
        }
        debug("ssh_rsa_verify: signature %scorrect", (ret==0) ? "in" : "");
        return ret;
index 9b4c38835a677dfae38905eb609434b38afbfdde..b89321fb8392b9154db711ec4df28e7d058e919d 100644 (file)
@@ -13,7 +13,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshconnect.c,v 1.125 2002/06/19 00:27:55 deraadt Exp $");
+RCSID("$OpenBSD: sshconnect.c,v 1.126 2002/06/23 03:30:17 deraadt Exp $");
 
 #include <openssl/bn.h>
 
@@ -266,7 +266,7 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr,
        memset(&hints, 0, sizeof(hints));
        hints.ai_family = family;
        hints.ai_socktype = SOCK_STREAM;
-       snprintf(strport, sizeof strport, "%d", port);
+       snprintf(strport, sizeof strport, "%u", port);
        if ((gaierr = getaddrinfo(host, strport, &hints, &aitop)) != 0)
                fatal("%s: %.100s: %s", __progname, host,
                    gai_strerror(gaierr));
@@ -489,7 +489,6 @@ confirm(const char *prompt)
  * check whether the supplied host key is valid, return -1 if the key
  * is not valid. the user_hostfile will not be updated if 'readonly' is true.
  */
-
 static int
 check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
     int readonly, const char *user_hostfile, const char *system_hostfile)
index 7f28ab51e79da2e9afa67c8bee300833a3e87216..215f76ca2e3673f7258d7b36d0499d4194f370b1 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshconnect2.c,v 1.104 2002/06/19 00:27:55 deraadt Exp $");
+RCSID("$OpenBSD: sshconnect2.c,v 1.105 2002/06/23 03:30:17 deraadt Exp $");
 
 #include "ssh.h"
 #include "ssh2.h"
@@ -299,12 +299,14 @@ userauth(Authctxt *authctxt, char *authlist)
                }
        }
 }
+
 void
 input_userauth_error(int type, u_int32_t seq, void *ctxt)
 {
        fatal("input_userauth_error: bad message during authentication: "
           "type %d", type);
 }
+
 void
 input_userauth_banner(int type, u_int32_t seq, void *ctxt)
 {
@@ -316,6 +318,7 @@ input_userauth_banner(int type, u_int32_t seq, void *ctxt)
        xfree(msg);
        xfree(lang);
 }
+
 void
 input_userauth_success(int type, u_int32_t seq, void *ctxt)
 {
@@ -327,6 +330,7 @@ input_userauth_success(int type, u_int32_t seq, void *ctxt)
        clear_auth_state(authctxt);
        authctxt->success = 1;                  /* break out */
 }
+
 void
 input_userauth_failure(int type, u_int32_t seq, void *ctxt)
 {
@@ -375,7 +379,7 @@ input_userauth_pk_ok(int type, u_int32_t seq, void *ctxt)
        }
        packet_check_eom();
 
-       debug("input_userauth_pk_ok: pkalg %s blen %d lastkey %p hint %d",
+       debug("input_userauth_pk_ok: pkalg %s blen %u lastkey %p hint %d",
            pkalg, blen, authctxt->last_key, authctxt->last_key_hint);
 
        do {
@@ -894,9 +898,7 @@ input_userauth_info_req(int type, u_int32_t seq, void *ctxt)
 }
 
 static int
-ssh_keysign(
-    Key *key,
-    u_char **sigp, u_int *lenp,
+ssh_keysign(Key *key, u_char **sigp, u_int *lenp,
     u_char *data, u_int datalen)
 {
        Buffer b;
@@ -1098,6 +1100,7 @@ authmethod_lookup(const char *name)
 static Authmethod *current = NULL;
 static char *supported = NULL;
 static char *preferred = NULL;
+
 /*
  * Given the authentication method list sent by the server, return the
  * next method we should try.  If the server initially sends a nil list,
diff --git a/sshd.c b/sshd.c
index 6b29e70944f00a36f8bb3c564131c3386353d5df..473b31670cf374b5b1253de1b485cc343a704ab9 100644 (file)
--- a/sshd.c
+++ b/sshd.c
@@ -42,7 +42,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshd.c,v 1.248 2002/06/22 20:05:27 stevesk Exp $");
+RCSID("$OpenBSD: sshd.c,v 1.249 2002/06/23 03:30:17 deraadt Exp $");
 
 #include <openssl/dh.h>
 #include <openssl/bn.h>
@@ -372,7 +372,8 @@ sshd_exchange_identification(int sock_in, int sock_out)
 
        if (client_version_string == NULL) {
                /* Send our protocol version identification. */
-               if (atomicio(write, sock_out, server_version_string, strlen(server_version_string))
+               if (atomicio(write, sock_out, server_version_string,
+                   strlen(server_version_string))
                    != strlen(server_version_string)) {
                        log("Could not write ident string to %s", get_remote_ipaddr());
                        fatal_cleanup();
@@ -475,7 +476,6 @@ sshd_exchange_identification(int sock_in, int sock_out)
        }
 }
 
-
 /* Destroy the host and server keys.  They will no longer be needed. */
 void
 destroy_sensitive_data(void)
index 78c51abd6793df415c5147cdcf1f8524230fbc7e..e76f94534daa9359c80b8d0a0120c8069b58dc3f 100644 (file)
@@ -39,7 +39,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshlogin.c,v 1.3 2001/12/19 07:18:56 deraadt Exp $");
+RCSID("$OpenBSD: sshlogin.c,v 1.4 2002/06/23 03:30:17 deraadt Exp $");
 
 #include "loginrec.h"
 
@@ -48,10 +48,9 @@ RCSID("$OpenBSD: sshlogin.c,v 1.3 2001/12/19 07:18:56 deraadt Exp $");
  * information is not available.  This must be called before record_login.
  * The host the user logged in from will be returned in buf.
  */
-
 u_long
 get_last_login_time(uid_t uid, const char *logname,
-                   char *buf, u_int bufsize)
+    char *buf, u_int bufsize)
 {
   struct logininfo li;
 
@@ -64,10 +63,9 @@ get_last_login_time(uid_t uid, const char *logname,
  * Records that the user has logged in.  I these parts of operating systems
  * were more standardized.
  */
-
 void
 record_login(pid_t pid, const char *ttyname, const char *user, uid_t uid,
-       const char *host, struct sockaddr * addr)
+    const char *host, struct sockaddr * addr)
 {
   struct logininfo *li;
 
@@ -92,7 +90,6 @@ record_utmp_only(pid_t pid, const char *ttyname, const char *user,
 #endif
 
 /* Records that the user has logged out. */
-
 void
 record_logout(pid_t pid, const char *ttyname, const char *user)
 {
index a7e7e27693bb856c0849cdfeee6c2a5e1e42f2d1..ce64e7a00b885ed1e32f04ad02ece9c3bebca409 100644 (file)
--- a/sshpty.c
+++ b/sshpty.c
@@ -12,7 +12,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshpty.c,v 1.4 2001/12/19 07:18:56 deraadt Exp $");
+RCSID("$OpenBSD: sshpty.c,v 1.5 2002/06/23 03:30:58 deraadt Exp $");
 
 #ifdef HAVE_UTIL_H
 # include <util.h>
@@ -394,11 +394,11 @@ pty_setowner(struct passwd *pw, const char *ttyname)
                if (chown(ttyname, pw->pw_uid, gid) < 0) {
                        if (errno == EROFS &&
                           (st.st_uid == pw->pw_uid || st.st_uid == 0))
-                               error("chown(%.100s, %d, %d) failed: %.100s",
+                               error("chown(%.100s, %u, %u) failed: %.100s",
                                    ttyname, pw->pw_uid, gid,
                                    strerror(errno));
                        else
-                               fatal("chown(%.100s, %d, %d) failed: %.100s",
+                               fatal("chown(%.100s, %u, %u) failed: %.100s",
                                    ttyname, pw->pw_uid, gid,
                                    strerror(errno));
                }
This page took 0.093498 seconds and 5 git commands to generate.