- 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.
#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>
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:
*/
#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>
#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;
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;
}
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;
}
if (len != SIGBLOB_LEN) {
- fatal("bad sigbloblen %d != SIGBLOB_LEN", len);
+ fatal("bad sigbloblen %u != SIGBLOB_LEN", len);
}
/* parse signature */
*/
#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>
/* 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;
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;
}
}
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;
/* 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);
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;
*/
#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>
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));
* 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)
*/
#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"
}
}
}
+
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)
{
xfree(msg);
xfree(lang);
}
+
void
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)
{
}
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 {
}
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;
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,
*/
#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>
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();
}
}
-
/* Destroy the host and server keys. They will no longer be needed. */
void
destroy_sensitive_data(void)
*/
#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"
* 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;
* 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;
#endif
/* Records that the user has logged out. */
-
void
record_logout(pid_t pid, const char *ttyname, const char *user)
{
*/
#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>
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));
}