summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Pechanec <Jan.Pechanec@Sun.COM>2009-04-09 03:03:26 -0700
committerJan Pechanec <Jan.Pechanec@Sun.COM>2009-04-09 03:03:26 -0700
commit5e358f39b60a8cd323fba47c4a7f79e7096cd0e6 (patch)
tree4bc4d88b56b79379116880edb4f692b03eb7bf27
parent0aa3b377a7a09e571b7be5753343ade81a04bba9 (diff)
downloadillumos-joyent-5e358f39b60a8cd323fba47c4a7f79e7096cd0e6.tar.gz
6824175 OpenSSL needs a fix for CVE-2009-0590
-rw-r--r--usr/src/common/openssl/crypto/asn1/asn1.h2
-rw-r--r--usr/src/common/openssl/crypto/asn1/asn1_err.c2
-rw-r--r--usr/src/common/openssl/crypto/asn1/tasn_dec.c12
-rw-r--r--usr/src/common/openssl/crypto/opensslv.h1
4 files changed, 17 insertions, 0 deletions
diff --git a/usr/src/common/openssl/crypto/asn1/asn1.h b/usr/src/common/openssl/crypto/asn1/asn1.h
index 2819678c2c..8781bef3bb 100644
--- a/usr/src/common/openssl/crypto/asn1/asn1.h
+++ b/usr/src/common/openssl/crypto/asn1/asn1.h
@@ -1132,6 +1132,7 @@ void ERR_load_ASN1_strings(void);
#define ASN1_R_BAD_OBJECT_HEADER 102
#define ASN1_R_BAD_PASSWORD_READ 103
#define ASN1_R_BAD_TAG 104
+#define ASN1_R_BMPSTRING_IS_WRONG_LENGTH 210
#define ASN1_R_BN_LIB 105
#define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 106
#define ASN1_R_BUFFER_TOO_SMALL 107
@@ -1211,6 +1212,7 @@ void ERR_load_ASN1_strings(void);
#define ASN1_R_UNABLE_TO_DECODE_RSA_KEY 157
#define ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY 158
#define ASN1_R_UNEXPECTED_EOC 159
+#define ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH 211
#define ASN1_R_UNKNOWN_FORMAT 160
#define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM 161
#define ASN1_R_UNKNOWN_OBJECT_TYPE 162
diff --git a/usr/src/common/openssl/crypto/asn1/asn1_err.c b/usr/src/common/openssl/crypto/asn1/asn1_err.c
index bef2519e65..8ea8652ad9 100644
--- a/usr/src/common/openssl/crypto/asn1/asn1_err.c
+++ b/usr/src/common/openssl/crypto/asn1/asn1_err.c
@@ -188,6 +188,7 @@ static ERR_STRING_DATA ASN1_str_reasons[]=
{ERR_REASON(ASN1_R_BAD_OBJECT_HEADER) ,"bad object header"},
{ERR_REASON(ASN1_R_BAD_PASSWORD_READ) ,"bad password read"},
{ERR_REASON(ASN1_R_BAD_TAG) ,"bad tag"},
+{ERR_REASON(ASN1_R_BMPSTRING_IS_WRONG_LENGTH),"bmpstring is wrong length"},
{ERR_REASON(ASN1_R_BN_LIB) ,"bn lib"},
{ERR_REASON(ASN1_R_BOOLEAN_IS_WRONG_LENGTH),"boolean is wrong length"},
{ERR_REASON(ASN1_R_BUFFER_TOO_SMALL) ,"buffer too small"},
@@ -267,6 +268,7 @@ static ERR_STRING_DATA ASN1_str_reasons[]=
{ERR_REASON(ASN1_R_UNABLE_TO_DECODE_RSA_KEY),"unable to decode rsa key"},
{ERR_REASON(ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY),"unable to decode rsa private key"},
{ERR_REASON(ASN1_R_UNEXPECTED_EOC) ,"unexpected eoc"},
+{ERR_REASON(ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH),"universalstring is wrong length"},
{ERR_REASON(ASN1_R_UNKNOWN_FORMAT) ,"unknown format"},
{ERR_REASON(ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM),"unknown message digest algorithm"},
{ERR_REASON(ASN1_R_UNKNOWN_OBJECT_TYPE) ,"unknown object type"},
diff --git a/usr/src/common/openssl/crypto/asn1/tasn_dec.c b/usr/src/common/openssl/crypto/asn1/tasn_dec.c
index 75399edfa8..26d66aa89c 100644
--- a/usr/src/common/openssl/crypto/asn1/tasn_dec.c
+++ b/usr/src/common/openssl/crypto/asn1/tasn_dec.c
@@ -1001,6 +1001,18 @@ int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
case V_ASN1_SET:
case V_ASN1_SEQUENCE:
default:
+ if (utype == V_ASN1_BMPSTRING && (len & 1))
+ {
+ ASN1err(ASN1_F_ASN1_EX_C2I,
+ ASN1_R_BMPSTRING_IS_WRONG_LENGTH);
+ goto err;
+ }
+ if (utype == V_ASN1_UNIVERSALSTRING && (len & 3))
+ {
+ ASN1err(ASN1_F_ASN1_EX_C2I,
+ ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH);
+ goto err;
+ }
/* All based on ASN1_STRING and handled the same */
if (!*pval)
{
diff --git a/usr/src/common/openssl/crypto/opensslv.h b/usr/src/common/openssl/crypto/opensslv.h
index 7dfefe80bc..16dc77b6dc 100644
--- a/usr/src/common/openssl/crypto/opensslv.h
+++ b/usr/src/common/openssl/crypto/opensslv.h
@@ -40,6 +40,7 @@
" CVE-2007-4995" \
" CVE-2007-5135" \
" CVE-2008-5077" \
+ " CVE-2009-0590" \
")"
#endif