summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Klishin <michael@clojurewerkz.org>2021-04-20 00:20:44 +0300
committerMichael Klishin <michael@clojurewerkz.org>2021-04-20 00:20:44 +0300
commite15f2b46f36829d85de95bdf28f5a59c78c4fcf4 (patch)
treef60365998d1d30ae35fd20da335de5d779dfc376
parenta17dde45bc309509046615a30f371fd775f66c06 (diff)
downloadrabbitmq-server-git-e15f2b46f36829d85de95bdf28f5a59c78c4fcf4.tar.gz
SAN of type otherName: strip two leading characters
instead of specific ones since they will vary with the payload (one of them likely indicates UTF string length). This is still not perfect because we limit the maximum allowed length but it works fine with identifiers up to 100 characters long, which should be good enough for this best effort handling of an abscure SAN type. References ##2983.
-rw-r--r--deps/rabbit_common/src/rabbit_cert_info.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/deps/rabbit_common/src/rabbit_cert_info.erl b/deps/rabbit_common/src/rabbit_cert_info.erl
index 2ea1ebd594..81a2fad8cc 100644
--- a/deps/rabbit_common/src/rabbit_cert_info.erl
+++ b/deps/rabbit_common/src/rabbit_cert_info.erl
@@ -112,7 +112,7 @@ find_by_type(Type, {rdnSequence, RDNs}) ->
sanitize_other_name(Bin) when is_binary(Bin) ->
%% strip off leading values that seem to be ASN.1 UTF value encoding artifacts
case Bin of
- <<12, 14, Rest/binary>> -> Rest;
+ <<_:2/binary, Rest/binary>> -> Rest;
Other -> Other
end.