Skip to content

Commit

Permalink
Pass Dialyzer
Browse files Browse the repository at this point in the history
x.509 certificate extensions do not really have types in
OTP's public_key, so our hands are tied.

(cherry picked from commit 1587501)
  • Loading branch information
michaelklishin committed Apr 19, 2021
1 parent 092377d commit f8f25e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions deps/rabbit/src/rabbit_ssl.erl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
{ssl_cipher_format, suite_map_to_openssl_str, 1},
{ssl_cipher_format, suite_map_to_bin, 1}]).

-dialyzer({nowarn_function, peer_cert_auth_name/2}).

-type certificate() :: rabbit_cert_info:certificate().

-type cipher_suites_mode() :: default | all | anonymous.
Expand Down
6 changes: 5 additions & 1 deletion deps/rabbit_common/src/rabbit_cert_info.erl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@

-type certificate() :: public_key:der_encoded().

%% x.509 certificate extensions usually look like key/value pairs but can
%% be just about any value
-type certificate_extension_value() :: any().

%%--------------------------------------------------------------------------
%% High-level functions used by reader
%%--------------------------------------------------------------------------
Expand Down Expand Up @@ -68,7 +72,7 @@ extensions(Cert) ->
Extensions
end, Cert).

-spec subject_alternative_names(certificate()) -> [{atom(), string()}].
-spec subject_alternative_names(certificate()) -> [certificate_extension_value()].
subject_alternative_names(Cert) ->
Extensions = extensions(Cert),
try lists:keyfind(?'id-ce-subjectAltName', #'Extension'.extnID, Extensions) of
Expand Down

0 comments on commit f8f25e7

Please sign in to comment.