From: Dr. Stephen Henson Date: Thu, 19 Jan 2006 17:19:43 +0000 (+0000) Subject: Correctly encode FALSE for BOOL in ASN1_TYPE. X-Git-Tag: OpenSSL_FIPS_1_0~36 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c1e67d98566cbc01149a2b6563f9da2fc1cd7bd9;p=oweals%2Fopenssl.git Correctly encode FALSE for BOOL in ASN1_TYPE. --- diff --git a/crypto/asn1/tasn_enc.c b/crypto/asn1/tasn_enc.c index f6c8ddef0a..c675c3c832 100644 --- a/crypto/asn1/tasn_enc.c +++ b/crypto/asn1/tasn_enc.c @@ -445,9 +445,12 @@ int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout, int *putype, const ASN1_ case V_ASN1_BOOLEAN: 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;