diff options
Diffstat (limited to 'bufbn.c')
-rw-r--r-- | bufbn.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bufbn.c,v 1.3 2006/08/03 03:34:41 deraadt Exp $*/ | 1 | /* $OpenBSD: bufbn.c,v 1.4 2006/11/06 21:25:28 markus Exp $*/ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -118,7 +118,10 @@ buffer_get_bignum_ret(Buffer *buffer, BIGNUM *value) | |||
118 | return (-1); | 118 | return (-1); |
119 | } | 119 | } |
120 | bin = buffer_ptr(buffer); | 120 | bin = buffer_ptr(buffer); |
121 | BN_bin2bn(bin, bytes, value); | 121 | if (BN_bin2bn(bin, bytes, value) == NULL) { |
122 | error("buffer_get_bignum_ret: BN_bin2bn failed"); | ||
123 | return (-1); | ||
124 | } | ||
122 | if (buffer_consume_ret(buffer, bytes) == -1) { | 125 | if (buffer_consume_ret(buffer, bytes) == -1) { |
123 | error("buffer_get_bignum_ret: buffer_consume failed"); | 126 | error("buffer_get_bignum_ret: buffer_consume failed"); |
124 | return (-1); | 127 | return (-1); |
@@ -202,7 +205,10 @@ buffer_get_bignum2_ret(Buffer *buffer, BIGNUM *value) | |||
202 | xfree(bin); | 205 | xfree(bin); |
203 | return (-1); | 206 | return (-1); |
204 | } | 207 | } |
205 | BN_bin2bn(bin, len, value); | 208 | if (BN_bin2bn(bin, len, value) == NULL) { |
209 | error("buffer_get_bignum2_ret: BN_bin2bn failed"); | ||
210 | return (-1); | ||
211 | } | ||
206 | xfree(bin); | 212 | xfree(bin); |
207 | return (0); | 213 | return (0); |
208 | } | 214 | } |