diff --git a/lib/public_key/BasicOcspResponse.data b/lib/public_key/BasicOcspResponse.data new file mode 100644 index 000000000000..016ce972c3c4 Binary files /dev/null and b/lib/public_key/BasicOcspResponse.data differ diff --git a/lib/public_key/README.txt b/lib/public_key/README.txt new file mode 100644 index 000000000000..6478e758995e --- /dev/null +++ b/lib/public_key/README.txt @@ -0,0 +1,13 @@ +{ok, Bin} = file:read_file("BasicOcspResponse.data"). + +%% decode everything +public_key:der_decode('BasicOCSPResponse', Bin). + +%% decode but not signature +'OTP-PUB-KEY':decode_BasicOCSPResponse_exclusive1(Bin). + +%% decode but not certs - 'parts' crashes with function_clause: 'OTP-PUB-KEY':decode_tag_and_length({asn1,"tag failure" +'OTP-PUB-KEY':decode_BasicOCSPResponse_exclusive2(Bin). + +%% decode but not certs - 'undecoded' returns error but shouldn't? +'OTP-PUB-KEY':decode_BasicOCSPResponse_exclusive3(Bin). diff --git a/lib/public_key/asn1/Makefile b/lib/public_key/asn1/Makefile index c1adf58ed49e..2377f719e7b7 100644 --- a/lib/public_key/asn1/Makefile +++ b/lib/public_key/asn1/Makefile @@ -48,7 +48,7 @@ EBIN = ../ebin ASN_TOP = OTP-PUB-KEY PKCS-FRAME ASN_MODULES = PKIX1Explicit88 PKIX1Implicit88 PKIX1Algorithms88 \ PKIXAttributeCertificate PKCS-1 PKCS-3 PKCS-7 PKCS-8 PKCS-10 PKCS5v2-0 OTP-PKIX \ - InformationFramework RFC5639 CMSAesRsaesOaep + InformationFramework RFC5639 CMSAesRsaesOaep OCSP-2013-88 ASN_ASNS = $(ASN_MODULES:%=%.asn1) ASN_ERLS = $(ASN_TOP:%=$(ESRC)/%.erl) ASN_HRLS = $(ASN_TOP:%=%.hrl) @@ -124,6 +124,7 @@ OTP-PUB-KEY.asn1db: PKIX1Algorithms88.asn1 \ PKCS-7.asn1\ PKCS-10.asn1\ InformationFramework.asn1\ + OCSP-2013-88.asn1\ OTP-PKIX.asn1 \ RFC5639.asn1 diff --git a/lib/public_key/asn1/OTP-PUB-KEY.asn1config b/lib/public_key/asn1/OTP-PUB-KEY.asn1config index 9ca30564af16..3543285c00b1 100644 --- a/lib/public_key/asn1/OTP-PUB-KEY.asn1config +++ b/lib/public_key/asn1/OTP-PUB-KEY.asn1config @@ -1,3 +1,14 @@ -{exclusive_decode,{'OTP-PUB-KEY', - [{decode_TBSCert_exclusive,['Certificate',[{tbsCertificate,undecoded}]]}, - {decode_TBSCertList_exclusive,['CertificateList',[{tbsCertList,undecoded}]]}]}}. +{exclusive_decode, + {'OTP-PUB-KEY', + [ + {decode_TBSCert_exclusive, + ['Certificate',[{tbsCertificate,undecoded}]]}, + %% {decode_TBSCertList_exclusive2, + %% ['CertificateList',[{tbsCertList,undecoded}]]}, + {decode_BasicOCSPResponse_exclusive1, + ['BasicOCSPResponse',[{signature,undecoded}]]} + %% ,{decode_BasicOCSPResponse_exclusive2, % FIXME1 + %% ['BasicOCSPResponse',[{certs,undecoded}]]} + %% ,{decode_BasicOCSPResponse_exclusive2, % FIXME2 + %% ['BasicOCSPResponse',[{certs,parts}]]} + ]}}.