diff options
author | Linus Nordberg <linus@nordu.net> | 2016-08-19 14:09:10 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2016-08-19 14:09:10 +0200 |
commit | 5ce811ec17bf5ca624794dcdb75cdc13dbdb7081 (patch) | |
tree | 2d915c3aad961675e84cb80f82d07302627c2569 /src/catlfish_compat.erl | |
parent | a4ef2ba028f9f3ba43a15934cb1ab95cad94cfa2 (diff) |
Support R18 wrt detoxing precerts.
Fixes CATLFISH-80.
Diffstat (limited to 'src/catlfish_compat.erl')
-rw-r--r-- | src/catlfish_compat.erl | 10 |
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). |