1 |
diff -up openssl-fips-0.9.8e/crypto/asn1/asn1_err.c.bad-string openssl-fips-0.9.8e/crypto/asn1/asn1_err.c |
2 |
--- openssl-fips-0.9.8e/crypto/asn1/asn1_err.c.bad-string 2006-11-21 21:14:36.000000000 +0100 |
3 |
+++ openssl-fips-0.9.8e/crypto/asn1/asn1_err.c 2009-04-15 16:31:18.000000000 +0200 |
4 |
@@ -188,6 +188,7 @@ static ERR_STRING_DATA ASN1_str_reasons[ |
5 |
{ERR_REASON(ASN1_R_BAD_OBJECT_HEADER) ,"bad object header"}, |
6 |
{ERR_REASON(ASN1_R_BAD_PASSWORD_READ) ,"bad password read"}, |
7 |
{ERR_REASON(ASN1_R_BAD_TAG) ,"bad tag"}, |
8 |
+{ERR_REASON(ASN1_R_BMPSTRING_IS_WRONG_LENGTH),"bmpstring is wrong length"}, |
9 |
{ERR_REASON(ASN1_R_BN_LIB) ,"bn lib"}, |
10 |
{ERR_REASON(ASN1_R_BOOLEAN_IS_WRONG_LENGTH),"boolean is wrong length"}, |
11 |
{ERR_REASON(ASN1_R_BUFFER_TOO_SMALL) ,"buffer too small"}, |
12 |
@@ -267,6 +268,7 @@ static ERR_STRING_DATA ASN1_str_reasons[ |
13 |
{ERR_REASON(ASN1_R_UNABLE_TO_DECODE_RSA_KEY),"unable to decode rsa key"}, |
14 |
{ERR_REASON(ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY),"unable to decode rsa private key"}, |
15 |
{ERR_REASON(ASN1_R_UNEXPECTED_EOC) ,"unexpected eoc"}, |
16 |
+{ERR_REASON(ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH),"universalstring is wrong length"}, |
17 |
{ERR_REASON(ASN1_R_UNKNOWN_FORMAT) ,"unknown format"}, |
18 |
{ERR_REASON(ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM),"unknown message digest algorithm"}, |
19 |
{ERR_REASON(ASN1_R_UNKNOWN_OBJECT_TYPE) ,"unknown object type"}, |
20 |
diff -up openssl-fips-0.9.8e/crypto/asn1/asn1.h.bad-string openssl-fips-0.9.8e/crypto/asn1/asn1.h |
21 |
--- openssl-fips-0.9.8e/crypto/asn1/asn1.h.bad-string 2009-04-15 13:48:50.000000000 +0200 |
22 |
+++ openssl-fips-0.9.8e/crypto/asn1/asn1.h 2009-04-15 16:31:18.000000000 +0200 |
23 |
@@ -1134,6 +1134,7 @@ void ERR_load_ASN1_strings(void); |
24 |
#define ASN1_R_BAD_OBJECT_HEADER 102 |
25 |
#define ASN1_R_BAD_PASSWORD_READ 103 |
26 |
#define ASN1_R_BAD_TAG 104 |
27 |
+#define ASN1_R_BMPSTRING_IS_WRONG_LENGTH 210 |
28 |
#define ASN1_R_BN_LIB 105 |
29 |
#define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 106 |
30 |
#define ASN1_R_BUFFER_TOO_SMALL 107 |
31 |
@@ -1213,6 +1214,7 @@ void ERR_load_ASN1_strings(void); |
32 |
#define ASN1_R_UNABLE_TO_DECODE_RSA_KEY 157 |
33 |
#define ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY 158 |
34 |
#define ASN1_R_UNEXPECTED_EOC 159 |
35 |
+#define ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH 211 |
36 |
#define ASN1_R_UNKNOWN_FORMAT 160 |
37 |
#define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM 161 |
38 |
#define ASN1_R_UNKNOWN_OBJECT_TYPE 162 |
39 |
diff -up openssl-fips-0.9.8e/crypto/asn1/tasn_dec.c.bad-string openssl-fips-0.9.8e/crypto/asn1/tasn_dec.c |
40 |
--- openssl-fips-0.9.8e/crypto/asn1/tasn_dec.c.bad-string 2007-01-23 18:54:22.000000000 +0100 |
41 |
+++ openssl-fips-0.9.8e/crypto/asn1/tasn_dec.c 2009-04-15 16:31:18.000000000 +0200 |
42 |
@@ -1012,6 +1012,18 @@ int asn1_ex_c2i(ASN1_VALUE **pval, const |
43 |
case V_ASN1_SET: |
44 |
case V_ASN1_SEQUENCE: |
45 |
default: |
46 |
+ if (utype == V_ASN1_BMPSTRING && (len & 1)) |
47 |
+ { |
48 |
+ ASN1err(ASN1_F_ASN1_EX_C2I, |
49 |
+ ASN1_R_BMPSTRING_IS_WRONG_LENGTH); |
50 |
+ goto err; |
51 |
+ } |
52 |
+ if (utype == V_ASN1_UNIVERSALSTRING && (len & 3)) |
53 |
+ { |
54 |
+ ASN1err(ASN1_F_ASN1_EX_C2I, |
55 |
+ ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH); |
56 |
+ goto err; |
57 |
+ } |
58 |
/* All based on ASN1_STRING and handled the same */ |
59 |
if (!*pval) |
60 |
{ |