diff options
author | Erlang/OTP <[email protected]> | 2010-09-29 08:44:06 +0200 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2010-09-29 08:44:06 +0200 |
commit | 8314712874d13fc22291d7f8187f04469b11527f (patch) | |
tree | 49c045e0ca1c29d082f1837c1302e50c4dea9a04 /lib/public_key/src/pubkey_cert.erl | |
parent | 1cc98776de446ca24e25aff2b67f897b39bdea01 (diff) | |
parent | f5d3597bcaff3109f0b9b1bd8b5d661bb04bb1e4 (diff) | |
download | otp-8314712874d13fc22291d7f8187f04469b11527f.tar.gz otp-8314712874d13fc22291d7f8187f04469b11527f.tar.bz2 otp-8314712874d13fc22291d7f8187f04469b11527f.zip |
Merge branch 'ia/public_key/basic_constraints/OTP-8867' into maint-r14
* ia/public_key/basic_constraints/OTP-8867:
Better handling of v1 and v2 certificates.
Diffstat (limited to 'lib/public_key/src/pubkey_cert.erl')
-rw-r--r-- | lib/public_key/src/pubkey_cert.erl | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/public_key/src/pubkey_cert.erl b/lib/public_key/src/pubkey_cert.erl index e704c168f1..f3e32617af 100644 --- a/lib/public_key/src/pubkey_cert.erl +++ b/lib/public_key/src/pubkey_cert.erl @@ -223,10 +223,15 @@ validate_revoked_status(_OtpCert, UserState, _VerifyFun) -> %%-------------------------------------------------------------------- validate_extensions(OtpCert, ValidationState, UserState, VerifyFun) -> TBSCert = OtpCert#'OTPCertificate'.tbsCertificate, - Extensions = TBSCert#'OTPTBSCertificate'.extensions, - validate_extensions(OtpCert, Extensions, ValidationState, no_basic_constraint, - is_self_signed(OtpCert), UserState, VerifyFun). - + case TBSCert#'OTPTBSCertificate'.version of + N when N >= 3 -> + Extensions = TBSCert#'OTPTBSCertificate'.extensions, + validate_extensions(OtpCert, Extensions, + ValidationState, no_basic_constraint, + is_self_signed(OtpCert), UserState, VerifyFun); + _ -> %% Extensions not present in versions 1 & 2 + {ValidationState, UserState} + end. %%-------------------------------------------------------------------- -spec normalize_general_name({rdnSequence, term()}) -> {rdnSequence, term()}. %% |