diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/f_int.c')
-rw-r--r-- | src/lib/libcrypto/asn1/f_int.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/lib/libcrypto/asn1/f_int.c b/src/lib/libcrypto/asn1/f_int.c index 4817c45cb7..55560dd814 100644 --- a/src/lib/libcrypto/asn1/f_int.c +++ b/src/lib/libcrypto/asn1/f_int.c | |||
@@ -58,15 +58,13 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "buffer.h" | 61 | #include <openssl/buffer.h> |
62 | #include "x509.h" | 62 | #include <openssl/asn1.h> |
63 | 63 | ||
64 | int i2a_ASN1_INTEGER(bp, a) | 64 | int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a) |
65 | BIO *bp; | ||
66 | ASN1_INTEGER *a; | ||
67 | { | 65 | { |
68 | int i,n=0; | 66 | int i,n=0; |
69 | static char *h="0123456789ABCDEF"; | 67 | static const char *h="0123456789ABCDEF"; |
70 | char buf[2]; | 68 | char buf[2]; |
71 | 69 | ||
72 | if (a == NULL) return(0); | 70 | if (a == NULL) return(0); |
@@ -96,11 +94,7 @@ err: | |||
96 | return(-1); | 94 | return(-1); |
97 | } | 95 | } |
98 | 96 | ||
99 | int a2i_ASN1_INTEGER(bp,bs,buf,size) | 97 | int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) |
100 | BIO *bp; | ||
101 | ASN1_INTEGER *bs; | ||
102 | char *buf; | ||
103 | int size; | ||
104 | { | 98 | { |
105 | int ret=0; | 99 | int ret=0; |
106 | int i,j,k,m,n,again,bufsize; | 100 | int i,j,k,m,n,again,bufsize; |
@@ -123,9 +117,18 @@ int size; | |||
123 | 117 | ||
124 | for (j=0; j<i; j++) | 118 | for (j=0; j<i; j++) |
125 | { | 119 | { |
120 | #ifndef CHARSET_EBCDIC | ||
126 | if (!( ((buf[j] >= '0') && (buf[j] <= '9')) || | 121 | if (!( ((buf[j] >= '0') && (buf[j] <= '9')) || |
127 | ((buf[j] >= 'a') && (buf[j] <= 'f')) || | 122 | ((buf[j] >= 'a') && (buf[j] <= 'f')) || |
128 | ((buf[j] >= 'A') && (buf[j] <= 'F')))) | 123 | ((buf[j] >= 'A') && (buf[j] <= 'F')))) |
124 | #else | ||
125 | /* This #ifdef is not strictly necessary, since | ||
126 | * the characters A...F a...f 0...9 are contiguous | ||
127 | * (yes, even in EBCDIC - but not the whole alphabet). | ||
128 | * Nevertheless, isxdigit() is faster. | ||
129 | */ | ||
130 | if (!isxdigit(buf[j])) | ||
131 | #endif | ||
129 | { | 132 | { |
130 | i=j; | 133 | i=j; |
131 | break; | 134 | break; |