summaryrefslogtreecommitdiff
path: root/bufaux.c
diff options
context:
space:
mode:
Diffstat (limited to 'bufaux.c')
-rw-r--r--bufaux.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bufaux.c b/bufaux.c
index f6ca7e9ae..5bc718623 100644
--- a/bufaux.c
+++ b/bufaux.c
@@ -37,7 +37,7 @@
37 */ 37 */
38 38
39#include "includes.h" 39#include "includes.h"
40RCSID("$OpenBSD: bufaux.c,v 1.18 2001/12/05 10:06:12 deraadt Exp $"); 40RCSID("$OpenBSD: bufaux.c,v 1.19 2001/12/19 07:18:56 deraadt Exp $");
41 41
42#include <openssl/bn.h> 42#include <openssl/bn.h>
43#include "bufaux.h" 43#include "bufaux.h"
@@ -62,7 +62,7 @@ buffer_put_bignum(Buffer *buffer, BIGNUM *value)
62 oi = BN_bn2bin(value, buf); 62 oi = BN_bn2bin(value, buf);
63 if (oi != bin_size) 63 if (oi != bin_size)
64 fatal("buffer_put_bignum: BN_bn2bin() failed: oi %d != bin_size %d", 64 fatal("buffer_put_bignum: BN_bn2bin() failed: oi %d != bin_size %d",
65 oi, bin_size); 65 oi, bin_size);
66 66
67 /* Store the number of bits in the buffer in two bytes, msb first. */ 67 /* Store the number of bits in the buffer in two bytes, msb first. */
68 PUT_16BIT(msg, bits); 68 PUT_16BIT(msg, bits);
@@ -112,14 +112,14 @@ buffer_put_bignum2(Buffer *buffer, BIGNUM *value)
112 oi = BN_bn2bin(value, buf+1); 112 oi = BN_bn2bin(value, buf+1);
113 if (oi != bytes-1) 113 if (oi != bytes-1)
114 fatal("buffer_put_bignum: BN_bn2bin() failed: oi %d != bin_size %d", 114 fatal("buffer_put_bignum: BN_bn2bin() failed: oi %d != bin_size %d",
115 oi, bytes); 115 oi, bytes);
116 hasnohigh = (buf[1] & 0x80) ? 0 : 1; 116 hasnohigh = (buf[1] & 0x80) ? 0 : 1;
117 if (value->neg) { 117 if (value->neg) {
118 /**XXX should be two's-complement */ 118 /**XXX should be two's-complement */
119 int i, carry; 119 int i, carry;
120 u_char *uc = buf; 120 u_char *uc = buf;
121 log("negativ!"); 121 log("negativ!");
122 for(i = bytes-1, carry = 1; i>=0; i--) { 122 for (i = bytes-1, carry = 1; i>=0; i--) {
123 uc[i] ^= 0xff; 123 uc[i] ^= 0xff;
124 if (carry) 124 if (carry)
125 carry = !++uc[i]; 125 carry = !++uc[i];