diff options
author | Ingela Anderton Andin <[email protected]> | 2010-09-27 10:38:16 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2010-09-27 10:38:16 +0200 |
commit | 8e9a96141120b43b4edf05705a2a261916a902a5 (patch) | |
tree | 353f78d93b1ec64216f83c42015ae871ec12ee35 /lib/public_key/src/pubkey_cert.erl | |
parent | 2e96bd45aeab647a839cd8b0a0741267cc0a70e5 (diff) | |
parent | 9c6809e4450e2323f2e4685b69ca4fa4bc8d579b (diff) | |
download | otp-8e9a96141120b43b4edf05705a2a261916a902a5.tar.gz otp-8e9a96141120b43b4edf05705a2a261916a902a5.tar.bz2 otp-8e9a96141120b43b4edf05705a2a261916a902a5.zip |
Merge branch 'ia/public_key/basic_constraints/OTP-8867' into dev
* 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 2335a4e4b4..ac59b6313d 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()}. %% |