summaryrefslogtreecommitdiff
path: root/usr.bin/gzsig/ssh2.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/gzsig/ssh2.c')
-rw-r--r--usr.bin/gzsig/ssh2.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/usr.bin/gzsig/ssh2.c b/usr.bin/gzsig/ssh2.c
index f508058ca00..f221cb2d8c6 100644
--- a/usr.bin/gzsig/ssh2.c
+++ b/usr.bin/gzsig/ssh2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh2.c,v 1.1 2005/05/28 01:57:30 marius Exp $ */
+/* $OpenBSD: ssh2.c,v 1.2 2005/05/29 09:10:23 djm Exp $ */
/*
* ssh2.c
*
@@ -20,6 +20,7 @@
#include <sys/types.h>
#include <sys/uio.h>
+#include <netinet/in.h>
#include <arpa/nameser.h>
#include <openssl/ssl.h>
#include <openssl/des.h>
@@ -30,6 +31,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <resolv.h>
#include <err.h>
#include "key.h"
@@ -49,7 +51,7 @@ _uudecode(const char *src, u_char *target, size_t targsize)
/* copy the 'readonly' source */
if ((encoded = strdup(src)) == NULL)
- err(1, "");
+ err(1, "strdup");
/* skip whitespace and data */
for (p = encoded; *p == ' ' || *p == '\t'; p++)
;
@@ -131,7 +133,7 @@ _read_bignum(struct iovec *iov, BIGNUM *bn)
int
ssh2_load_public(struct key *k, struct iovec *iovp)
{
- int len, keytype, error = 0, blen;
+ int len, keytype, error = 0;
u_char *bp;
struct iovec iov;
/* iov->iov_base is NULL terminated */
@@ -150,7 +152,7 @@ ssh2_load_public(struct key *k, struct iovec *iovp)
len = 2*strlen(cp);
if ((savep = iov.iov_base = malloc(len)) == NULL)
- err(1, "");
+ err(1, "malloc(%d)", len);
iov.iov_len = _uudecode(cp, iov.iov_base, len);
if (_read_opaque(&iov, &bp, &len) < 0 ||
@@ -167,7 +169,7 @@ ssh2_load_public(struct key *k, struct iovec *iovp)
if ((rsa = RSA_new()) == NULL ||
(rsa->e = BN_new()) == NULL ||
(rsa->n = BN_new()) == NULL)
- errx(1, "");
+ errx(1, "BN_new");
if (_read_bignum(&iov, rsa->e) < 0 ||
_read_bignum(&iov, rsa->n) < 0) {
@@ -188,7 +190,7 @@ ssh2_load_public(struct key *k, struct iovec *iovp)
(dsa->q = BN_new()) == NULL ||
(dsa->g = BN_new()) == NULL ||
(dsa->pub_key = BN_new()) == NULL)
- errx(1, "");
+ errx(1, "BN_new");
if (_read_bignum(&iov, dsa->p) < 0 ||
_read_bignum(&iov, dsa->q) < 0 ||