diff options
| author | djm <> | 2008-09-06 12:15:56 +0000 |
|---|---|---|
| committer | djm <> | 2008-09-06 12:15:56 +0000 |
| commit | 5a3c0a05c7f2c5d3c584b7c8d6aec836dd724c80 (patch) | |
| tree | aba68249883aa9d2361d92eef69a81d0c4961732 /src/lib/libcrypto/asn1/x_long.c | |
| parent | f6198d4d0ab97685dc56be2d48715ed39fcc74b9 (diff) | |
| download | openbsd-5a3c0a05c7f2c5d3c584b7c8d6aec836dd724c80.tar.gz openbsd-5a3c0a05c7f2c5d3c584b7c8d6aec836dd724c80.tar.bz2 openbsd-5a3c0a05c7f2c5d3c584b7c8d6aec836dd724c80.zip | |
import of OpenSSL 0.9.8h
Diffstat (limited to 'src/lib/libcrypto/asn1/x_long.c')
| -rw-r--r-- | src/lib/libcrypto/asn1/x_long.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libcrypto/asn1/x_long.c b/src/lib/libcrypto/asn1/x_long.c index c5f25956cb..0db233cb95 100644 --- a/src/lib/libcrypto/asn1/x_long.c +++ b/src/lib/libcrypto/asn1/x_long.c | |||
| @@ -59,6 +59,7 @@ | |||
| 59 | #include <stdio.h> | 59 | #include <stdio.h> |
| 60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
| 61 | #include <openssl/asn1t.h> | 61 | #include <openssl/asn1t.h> |
| 62 | #include <openssl/bn.h> | ||
| 62 | 63 | ||
| 63 | /* Custom primitive type for long handling. This converts between an ASN1_INTEGER | 64 | /* Custom primitive type for long handling. This converts between an ASN1_INTEGER |
| 64 | * and a long directly. | 65 | * and a long directly. |
| @@ -69,7 +70,7 @@ static int long_new(ASN1_VALUE **pval, const ASN1_ITEM *it); | |||
| 69 | static void long_free(ASN1_VALUE **pval, const ASN1_ITEM *it); | 70 | static void long_free(ASN1_VALUE **pval, const ASN1_ITEM *it); |
| 70 | 71 | ||
| 71 | static int long_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it); | 72 | static int long_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it); |
| 72 | static int long_c2i(ASN1_VALUE **pval, unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it); | 73 | static int long_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it); |
| 73 | 74 | ||
| 74 | static ASN1_PRIMITIVE_FUNCS long_pf = { | 75 | static ASN1_PRIMITIVE_FUNCS long_pf = { |
| 75 | NULL, 0, | 76 | NULL, 0, |
| @@ -136,13 +137,14 @@ static int long_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const A | |||
| 136 | return clen + pad; | 137 | return clen + pad; |
| 137 | } | 138 | } |
| 138 | 139 | ||
| 139 | static int long_c2i(ASN1_VALUE **pval, unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it) | 140 | static int long_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, |
| 141 | int utype, char *free_cont, const ASN1_ITEM *it) | ||
| 140 | { | 142 | { |
| 141 | int neg, i; | 143 | int neg, i; |
| 142 | long ltmp; | 144 | long ltmp; |
| 143 | unsigned long utmp = 0; | 145 | unsigned long utmp = 0; |
| 144 | char *cp = (char *)pval; | 146 | char *cp = (char *)pval; |
| 145 | if(len > sizeof(long)) { | 147 | if(len > (int)sizeof(long)) { |
| 146 | ASN1err(ASN1_F_LONG_C2I, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG); | 148 | ASN1err(ASN1_F_LONG_C2I, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG); |
| 147 | return 0; | 149 | return 0; |
| 148 | } | 150 | } |
