summaryrefslogtreecommitdiff
path: root/src/catlfish_compat.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/catlfish_compat.erl')
-rw-r--r--src/catlfish_compat.erl10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/catlfish_compat.erl b/src/catlfish_compat.erl
index 55c2b2e..183eb44 100644
--- a/src/catlfish_compat.erl
+++ b/src/catlfish_compat.erl
@@ -1,11 +1,13 @@
-module(catlfish_compat).
--export([unpack_issuer/1, unpack_signature/1]).
+-export([unpack_issuer/1, unpack_signature/1, poison_val/1]).
-include_lib("public_key/include/public_key.hrl").
unpack_issuer(Issuer) ->
unpack_issuer(erlang:system_info(otp_release), Issuer).
unpack_signature(Signature) ->
unpack_signature(erlang:system_info(otp_release), Signature).
+poison_val(Value) ->
+ poison_val(erlang:system_info(otp_release), Value).
%% @doc Dig out alg, params and key from issuer.
unpack_issuer("17", Issuer) ->
@@ -25,3 +27,9 @@ unpack_signature("17", Signature) ->
Sig;
unpack_signature("18", Signature) ->
Signature.
+
+%% Use a list for R17 and a binary for newer versions.
+poison_val("17", Val) ->
+ Val;
+poison_val("18", Val) ->
+ list_to_binary(Val).