diff options
author | beck <> | 1999-09-29 04:37:45 +0000 |
---|---|---|
committer | beck <> | 1999-09-29 04:37:45 +0000 |
commit | de8f24ea083384bb66b32ec105dc4743c5663cdf (patch) | |
tree | 1412176ae62a3cab2cf2b0b92150fcbceaac6092 /src/lib/libcrypto/bn/bn_print.c | |
parent | cb929d29896bcb87c2a97417fbd03e50078fc178 (diff) | |
download | openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.gz openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.bz2 openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.zip |
OpenSSL 0.9.4 merge
Diffstat (limited to 'src/lib/libcrypto/bn/bn_print.c')
-rw-r--r-- | src/lib/libcrypto/bn/bn_print.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/src/lib/libcrypto/bn/bn_print.c b/src/lib/libcrypto/bn/bn_print.c index 2bcc11c852..2f5ab2617b 100644 --- a/src/lib/libcrypto/bn/bn_print.c +++ b/src/lib/libcrypto/bn/bn_print.c | |||
@@ -59,14 +59,13 @@ | |||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include <ctype.h> | 60 | #include <ctype.h> |
61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
62 | #include "buffer.h" | 62 | #include <openssl/buffer.h> |
63 | #include "bn_lcl.h" | 63 | #include "bn_lcl.h" |
64 | 64 | ||
65 | static char *Hex="0123456789ABCDEF"; | 65 | static const char *Hex="0123456789ABCDEF"; |
66 | 66 | ||
67 | /* Must 'Free' the returned data */ | 67 | /* Must 'Free' the returned data */ |
68 | char *BN_bn2hex(a) | 68 | char *BN_bn2hex(const BIGNUM *a) |
69 | BIGNUM *a; | ||
70 | { | 69 | { |
71 | int i,j,v,z=0; | 70 | int i,j,v,z=0; |
72 | char *buf; | 71 | char *buf; |
@@ -101,8 +100,7 @@ err: | |||
101 | } | 100 | } |
102 | 101 | ||
103 | /* Must 'Free' the returned data */ | 102 | /* Must 'Free' the returned data */ |
104 | char *BN_bn2dec(a) | 103 | char *BN_bn2dec(const BIGNUM *a) |
105 | BIGNUM *a; | ||
106 | { | 104 | { |
107 | int i=0,num; | 105 | int i=0,num; |
108 | char *buf=NULL; | 106 | char *buf=NULL; |
@@ -156,9 +154,7 @@ err: | |||
156 | return(buf); | 154 | return(buf); |
157 | } | 155 | } |
158 | 156 | ||
159 | int BN_hex2bn(bn,a) | 157 | int BN_hex2bn(BIGNUM **bn, const char *a) |
160 | BIGNUM **bn; | ||
161 | char *a; | ||
162 | { | 158 | { |
163 | BIGNUM *ret=NULL; | 159 | BIGNUM *ret=NULL; |
164 | BN_ULONG l=0; | 160 | BN_ULONG l=0; |
@@ -169,7 +165,7 @@ char *a; | |||
169 | 165 | ||
170 | if (*a == '-') { neg=1; a++; } | 166 | if (*a == '-') { neg=1; a++; } |
171 | 167 | ||
172 | for (i=0; isxdigit(a[i]); i++) | 168 | for (i=0; isxdigit((unsigned char) a[i]); i++) |
173 | ; | 169 | ; |
174 | 170 | ||
175 | num=i+neg; | 171 | num=i+neg; |
@@ -224,9 +220,7 @@ err: | |||
224 | return(0); | 220 | return(0); |
225 | } | 221 | } |
226 | 222 | ||
227 | int BN_dec2bn(bn,a) | 223 | int BN_dec2bn(BIGNUM **bn, const char *a) |
228 | BIGNUM **bn; | ||
229 | char *a; | ||
230 | { | 224 | { |
231 | BIGNUM *ret=NULL; | 225 | BIGNUM *ret=NULL; |
232 | BN_ULONG l=0; | 226 | BN_ULONG l=0; |
@@ -236,7 +230,7 @@ char *a; | |||
236 | if ((a == NULL) || (*a == '\0')) return(0); | 230 | if ((a == NULL) || (*a == '\0')) return(0); |
237 | if (*a == '-') { neg=1; a++; } | 231 | if (*a == '-') { neg=1; a++; } |
238 | 232 | ||
239 | for (i=0; isdigit(a[i]); i++) | 233 | for (i=0; isdigit((unsigned char) a[i]); i++) |
240 | ; | 234 | ; |
241 | 235 | ||
242 | num=i+neg; | 236 | num=i+neg; |
@@ -286,9 +280,7 @@ err: | |||
286 | #ifndef NO_BIO | 280 | #ifndef NO_BIO |
287 | 281 | ||
288 | #ifndef NO_FP_API | 282 | #ifndef NO_FP_API |
289 | int BN_print_fp(fp, a) | 283 | int BN_print_fp(FILE *fp, BIGNUM *a) |
290 | FILE *fp; | ||
291 | BIGNUM *a; | ||
292 | { | 284 | { |
293 | BIO *b; | 285 | BIO *b; |
294 | int ret; | 286 | int ret; |
@@ -302,9 +294,7 @@ BIGNUM *a; | |||
302 | } | 294 | } |
303 | #endif | 295 | #endif |
304 | 296 | ||
305 | int BN_print(bp, a) | 297 | int BN_print(BIO *bp, const BIGNUM *a) |
306 | BIO *bp; | ||
307 | BIGNUM *a; | ||
308 | { | 298 | { |
309 | int i,j,v,z=0; | 299 | int i,j,v,z=0; |
310 | int ret=0; | 300 | int ret=0; |