Blame SOURCES/openssl-fips-0.9.8e-cve-2009-0590.patch

5820f5
diff -up openssl-fips-0.9.8e/crypto/asn1/asn1_err.c.bad-string openssl-fips-0.9.8e/crypto/asn1/asn1_err.c
5820f5
--- openssl-fips-0.9.8e/crypto/asn1/asn1_err.c.bad-string	2006-11-21 21:14:36.000000000 +0100
5820f5
+++ openssl-fips-0.9.8e/crypto/asn1/asn1_err.c	2009-04-15 16:31:18.000000000 +0200
5820f5
@@ -188,6 +188,7 @@ static ERR_STRING_DATA ASN1_str_reasons[
5820f5
 {ERR_REASON(ASN1_R_BAD_OBJECT_HEADER)    ,"bad object header"},
5820f5
 {ERR_REASON(ASN1_R_BAD_PASSWORD_READ)    ,"bad password read"},
5820f5
 {ERR_REASON(ASN1_R_BAD_TAG)              ,"bad tag"},
5820f5
+{ERR_REASON(ASN1_R_BMPSTRING_IS_WRONG_LENGTH),"bmpstring is wrong length"},
5820f5
 {ERR_REASON(ASN1_R_BN_LIB)               ,"bn lib"},
5820f5
 {ERR_REASON(ASN1_R_BOOLEAN_IS_WRONG_LENGTH),"boolean is wrong length"},
5820f5
 {ERR_REASON(ASN1_R_BUFFER_TOO_SMALL)     ,"buffer too small"},
5820f5
@@ -267,6 +268,7 @@ static ERR_STRING_DATA ASN1_str_reasons[
5820f5
 {ERR_REASON(ASN1_R_UNABLE_TO_DECODE_RSA_KEY),"unable to decode rsa key"},
5820f5
 {ERR_REASON(ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY),"unable to decode rsa private key"},
5820f5
 {ERR_REASON(ASN1_R_UNEXPECTED_EOC)       ,"unexpected eoc"},
5820f5
+{ERR_REASON(ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH),"universalstring is wrong length"},
5820f5
 {ERR_REASON(ASN1_R_UNKNOWN_FORMAT)       ,"unknown format"},
5820f5
 {ERR_REASON(ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM),"unknown message digest algorithm"},
5820f5
 {ERR_REASON(ASN1_R_UNKNOWN_OBJECT_TYPE)  ,"unknown object type"},
5820f5
diff -up openssl-fips-0.9.8e/crypto/asn1/asn1.h.bad-string openssl-fips-0.9.8e/crypto/asn1/asn1.h
5820f5
--- openssl-fips-0.9.8e/crypto/asn1/asn1.h.bad-string	2009-04-15 13:48:50.000000000 +0200
5820f5
+++ openssl-fips-0.9.8e/crypto/asn1/asn1.h	2009-04-15 16:31:18.000000000 +0200
5820f5
@@ -1134,6 +1134,7 @@ void ERR_load_ASN1_strings(void);
5820f5
 #define ASN1_R_BAD_OBJECT_HEADER			 102
5820f5
 #define ASN1_R_BAD_PASSWORD_READ			 103
5820f5
 #define ASN1_R_BAD_TAG					 104
5820f5
+#define ASN1_R_BMPSTRING_IS_WRONG_LENGTH		 210
5820f5
 #define ASN1_R_BN_LIB					 105
5820f5
 #define ASN1_R_BOOLEAN_IS_WRONG_LENGTH			 106
5820f5
 #define ASN1_R_BUFFER_TOO_SMALL				 107
5820f5
@@ -1213,6 +1214,7 @@ void ERR_load_ASN1_strings(void);
5820f5
 #define ASN1_R_UNABLE_TO_DECODE_RSA_KEY			 157
5820f5
 #define ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY		 158
5820f5
 #define ASN1_R_UNEXPECTED_EOC				 159
5820f5
+#define ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH		 211
5820f5
 #define ASN1_R_UNKNOWN_FORMAT				 160
5820f5
 #define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM		 161
5820f5
 #define ASN1_R_UNKNOWN_OBJECT_TYPE			 162
5820f5
diff -up openssl-fips-0.9.8e/crypto/asn1/tasn_dec.c.bad-string openssl-fips-0.9.8e/crypto/asn1/tasn_dec.c
5820f5
--- openssl-fips-0.9.8e/crypto/asn1/tasn_dec.c.bad-string	2007-01-23 18:54:22.000000000 +0100
5820f5
+++ openssl-fips-0.9.8e/crypto/asn1/tasn_dec.c	2009-04-15 16:31:18.000000000 +0200
5820f5
@@ -1012,6 +1012,18 @@ int asn1_ex_c2i(ASN1_VALUE **pval, const
5820f5
 		case V_ASN1_SET:
5820f5
 		case V_ASN1_SEQUENCE:
5820f5
 		default:
5820f5
+		if (utype == V_ASN1_BMPSTRING && (len & 1))
5820f5
+			{
5820f5
+			ASN1err(ASN1_F_ASN1_EX_C2I,
5820f5
+					ASN1_R_BMPSTRING_IS_WRONG_LENGTH);
5820f5
+			goto err;
5820f5
+			}
5820f5
+		if (utype == V_ASN1_UNIVERSALSTRING && (len & 3))
5820f5
+			{
5820f5
+			ASN1err(ASN1_F_ASN1_EX_C2I,
5820f5
+					ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH);
5820f5
+			goto err;
5820f5
+			}
5820f5
 		/* All based on ASN1_STRING and handled the same */
5820f5
 		if (!*pval)
5820f5
 			{