From: Dr. Stephen Henson Date: Thu, 19 Jan 2006 17:16:56 +0000 (+0000) Subject: Fixes for BOOL handling: produce errors for invalid string for mini-compiler, X-Git-Tag: OpenSSL_0_9_8k^2~1580 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=25a58453ff5b73e7b4d5e2764d7924424694a82a;p=oweals%2Fopenssl.git Fixes for BOOL handling: produce errors for invalid string for mini-compiler, correctly encode FALSE for BOOL in ASN1_TYPE. --- diff --git a/crypto/asn1/asn1_gen.c b/crypto/asn1/asn1_gen.c index dd5853c02f..aaa2c7eb3f 100644 --- a/crypto/asn1/asn1_gen.c +++ b/crypto/asn1/asn1_gen.c @@ -660,6 +660,8 @@ static ASN1_TYPE *asn1_str2type(const char *str, int format, int utype) ASN1err(ASN1_F_ASN1_STR2TYPE, ASN1_R_NOT_ASCII_FORMAT); goto bad_form; } + vtmp.name = NULL; + vtmp.section = NULL; vtmp.value = (char *)str; if (!X509V3_get_value_bool(&vtmp, &atmp->value.boolean)) { diff --git a/crypto/asn1/tasn_enc.c b/crypto/asn1/tasn_enc.c index 60b29ce822..685401e163 100644 --- a/crypto/asn1/tasn_enc.c +++ b/crypto/asn1/tasn_enc.c @@ -618,11 +618,14 @@ int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout, int *putype, tbool = (ASN1_BOOLEAN *)pval; if (*tbool == -1) return -1; - /* Default handling if value == size field then omit */ - if (*tbool && (it->size > 0)) - return -1; - if (!*tbool && !it->size) - return -1; + if (it->utype != V_ASN1_ANY) + { + /* Default handling if value == size field then omit */ + if (*tbool && (it->size > 0)) + return -1; + if (!*tbool && !it->size) + return -1; + } c = (unsigned char)*tbool; cont = &c; len = 1;