aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2010-09-29 08:44:06 +0200
committerErlang/OTP <[email protected]>2010-09-29 08:44:06 +0200
commit8314712874d13fc22291d7f8187f04469b11527f (patch)
tree49c045e0ca1c29d082f1837c1302e50c4dea9a04
parent1cc98776de446ca24e25aff2b67f897b39bdea01 (diff)
parentf5d3597bcaff3109f0b9b1bd8b5d661bb04bb1e4 (diff)
downloadotp-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.
-rw-r--r--lib/public_key/src/pubkey_cert.erl13
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()}.
%%