aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/asn1/asn1_mac.h
diff options
context:
space:
mode:
authorstephen <stephen>1998-12-31 00:59:02 +0000
committerstephen <stephen>1998-12-31 00:59:02 +0000
commite9b8eb315556eedb77e5cff818f798d5065a31c6 (patch)
treec4ef5c6a6d73a787612d3beb240cffb2e05f930d /crypto/asn1/asn1_mac.h
parent88fce97953e0bdafbe8f8538f074cb778777bb9c (diff)
downloadopenssl-e9b8eb315556eedb77e5cff818f798d5065a31c6.tar.gz
Fix for sk_insert bug: it never worked properly.
Allow explicit tag asn macros to handle indefinite length constructed stuff: without this certain "certificates" can't be read in.
Diffstat (limited to 'crypto/asn1/asn1_mac.h')
-rw-r--r--crypto/asn1/asn1_mac.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/crypto/asn1/asn1_mac.h b/crypto/asn1/asn1_mac.h
index 834ed58f74..d4e36fb1db 100644
--- a/crypto/asn1/asn1_mac.h
+++ b/crypto/asn1/asn1_mac.h
@@ -213,8 +213,16 @@ err:\
if (Tinf & 0x80) \
{ c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \
c.line=__LINE__; goto err; } \
+ if (Tinf == (V_ASN1_CONSTRUCTED+1)) \
+ Tlen = c.slen - (c.p - c.q) - 2; \
if (func(&(r),&c.p,Tlen) == NULL) \
{ c.line=__LINE__; goto err; } \
+ if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \
+ Tlen = c.slen - (c.p - c.q); \
+ if(!ASN1_check_infinite_end(&c.p, Tlen)) \
+ { c.error=ERR_R_MISSING_ASN1_EOS; \
+ c.line=__LINE__; goto err; } \
+ }\
c.slen-=(c.p-c.q); \
}
@@ -230,10 +238,18 @@ err:\
if (Tinf & 0x80) \
{ c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \
c.line=__LINE__; goto err; } \
+ if (Tinf == (V_ASN1_CONSTRUCTED+1)) \
+ Tlen = c.slen - (c.p - c.q) - 2; \
if (d2i_ASN1_SET(&(r),&c.p,Tlen,(char *(*)())func, \
(void (*)())free_func, \
b,V_ASN1_UNIVERSAL) == NULL) \
{ c.line=__LINE__; goto err; } \
+ if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \
+ Tlen = c.slen - (c.p - c.q); \
+ if(!ASN1_check_infinite_end(&c.p, Tlen)) \
+ { c.error=ERR_R_MISSING_ASN1_EOS; \
+ c.line=__LINE__; goto err; } \
+ }\
c.slen-=(c.p-c.q); \
}