summaryrefslogtreecommitdiffstats
path: root/bufbn.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2006-11-07 23:14:41 +1100
committerDarren Tucker <dtucker@zip.com.au>2006-11-07 23:14:41 +1100
commit0bc85579a9b5a106826169303dd2ee61c63c161e (patch)
treed98e767f275d45b4c62984fb73a3484a5b8e134f /bufbn.c
parentdf0e438a2e4efe0422f6e0deb732d819d5938437 (diff)
- markus@cvs.openbsd.org 2006/11/06 21:25:28
[auth-rsa.c kexgexc.c kexdhs.c key.c ssh-dss.c sshd.c kexgexs.c ssh-keygen.c bufbn.c moduli.c scard.c kexdhc.c sshconnect1.c dh.c rsa.c] add missing checks for openssl return codes; with & ok djm@
Diffstat (limited to 'bufbn.c')
-rw-r--r--bufbn.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/bufbn.c b/bufbn.c
index 6cf65d37..9706ba8a 100644
--- a/bufbn.c
+++ b/bufbn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bufbn.c,v 1.3 2006/08/03 03:34:41 deraadt Exp $*/
+/* $OpenBSD: bufbn.c,v 1.4 2006/11/06 21:25:28 markus Exp $*/
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -118,7 +118,10 @@ buffer_get_bignum_ret(Buffer *buffer, BIGNUM *value)
return (-1);
}
bin = buffer_ptr(buffer);
- BN_bin2bn(bin, bytes, value);
+ if (BN_bin2bn(bin, bytes, value) == NULL) {
+ error("buffer_get_bignum_ret: BN_bin2bn failed");
+ return (-1);
+ }
if (buffer_consume_ret(buffer, bytes) == -1) {
error("buffer_get_bignum_ret: buffer_consume failed");
return (-1);
@@ -202,7 +205,10 @@ buffer_get_bignum2_ret(Buffer *buffer, BIGNUM *value)
xfree(bin);
return (-1);
}
- BN_bin2bn(bin, len, value);
+ if (BN_bin2bn(bin, len, value) == NULL) {
+ error("buffer_get_bignum2_ret: BN_bin2bn failed");
+ return (-1);
+ }
xfree(bin);
return (0);
}