summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2016-11-22 15:35:16 +0100
committerLinus Nordberg <linus@nordu.net>2016-11-26 18:37:49 +0100
commit1b78e42835c11d7c124a6bbbc36f1ac4083f2d06 (patch)
treedc4f603d3973b6c6c066212fc1199b00180a82d1
parent61ab81cf083db672b9278786139244994c84b333 (diff)
Added back support for R16
This change was lost in 616be2a.
-rw-r--r--src/catlfish_compat.erl10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/catlfish_compat.erl b/src/catlfish_compat.erl
index 183eb44..6dab325 100644
--- a/src/catlfish_compat.erl
+++ b/src/catlfish_compat.erl
@@ -10,6 +10,11 @@ poison_val(Value) ->
poison_val(erlang:system_info(otp_release), Value).
%% @doc Dig out alg, params and key from issuer.
+unpack_issuer("R16" ++ _, Issuer) ->
+ #'SubjectPublicKeyInfo'{
+ algorithm = #'AlgorithmIdentifier'{algorithm = Alg, parameters = Params},
+ subjectPublicKey = {0, Key}} = Issuer,
+ {Alg, Params, Key};
unpack_issuer("17", Issuer) ->
#'SubjectPublicKeyInfo'{
algorithm = #'AlgorithmIdentifier'{algorithm = Alg, parameters = Params},
@@ -22,6 +27,9 @@ unpack_issuer("18", Issuer) ->
{Alg, Params, Key}.
%% @doc Unpack a #'Certificate'.signature, return the signature.
+unpack_signature("R16" ++ _, Signature) ->
+ {_, Sig} = Signature,
+ Sig;
unpack_signature("17", Signature) ->
{_, Sig} = Signature,
Sig;
@@ -29,6 +37,8 @@ unpack_signature("18", Signature) ->
Signature.
%% Use a list for R17 and a binary for newer versions.
+poison_val("R16" ++ _, Val) ->
+ Val;
poison_val("17", Val) ->
Val;
poison_val("18", Val) ->