Skip to content

Commit

Permalink
Merge branch 'ia/public_key/basic_constraints/OTP-8867' into dev
Browse files Browse the repository at this point in the history
* ia/public_key/basic_constraints/OTP-8867:
  Better handling of v1 and v2 certificates.
  • Loading branch information
IngelaAndin committed Sep 27, 2010
2 parents 2e96bd4 + 9c6809e commit 8e9a961
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/public_key/src/pubkey_cert.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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()}.
%%
Expand Down

0 comments on commit 8e9a961

Please sign in to comment.