From 10f7b5a548a9a38c9c98e52a99b4af510f794884 Mon Sep 17 00:00:00 2001 From: Konstantinos Kallas Date: Tue, 22 Aug 2017 10:25:37 +0300 Subject: [PATCH] Remove partial RSA key support --- rebar.config | 2 -- src/ejabberd_acme.erl | 20 -------------------- 2 files changed, 22 deletions(-) diff --git a/rebar.config b/rebar.config index 0383fb084..d8f19042c 100644 --- a/rebar.config +++ b/rebar.config @@ -96,8 +96,6 @@ {if_have_fun, {rand, uniform, 1}, {d, 'RAND_UNIFORM'}}, {if_have_fun, {gb_sets, iterator_from, 2}, {d, 'GB_SETS_ITERATOR_FROM'}}, {if_have_fun, {public_key, short_name_hash, 1}, {d, 'SHORT_NAME_HASH'}}, - %% {if_have_fun, {public_key, generate_key, 1}, {d, 'GENERATE_RSA_KEY'}}, - {if_version_above, "19", {d, 'GENERATE_RSA_KEY'}}, {if_var_true, hipe, native}, {src_dirs, [asn1, src, {if_var_true, tools, tools}, diff --git a/src/ejabberd_acme.erl b/src/ejabberd_acme.erl index 869ecf03f..952a8cb85 100644 --- a/src/ejabberd_acme.erl +++ b/src/ejabberd_acme.erl @@ -730,18 +730,6 @@ not_before_not_after() -> -spec to_public(jose_jwk:key()) -> jose_jwk:key(). to_public(PrivateKey) -> jose_jwk:to_public(PrivateKey). -%% case jose_jwk:to_key(PrivateKey) of -%% #'RSAPrivateKey'{modulus = Mod, publicExponent = Exp} -> -%% Public = #'RSAPublicKey'{modulus = Mod, publicExponent = Exp}, -%% jose_jwk:from_key(Public); -%% _ -> -%% jose_jwk:to_public(PrivateKey) -%% end. - -%% to_public(#'RSAPrivateKey'{modulus = Mod, publicExponent = Exp}) -> -%% #'RSAPublicKey'{modulus = Mod, publicExponent = Exp}; -%% to_public(PrivateKey) -> -%% jose_jwk:to_public(PrivateKey). -spec pem_to_certificate(pem()) -> #'Certificate'{}. pem_to_certificate(Pem) -> @@ -1054,16 +1042,8 @@ get_config_cert_dir() -> end. --ifdef(GENERATE_RSA_KEY). -generate_key() -> - Key = public_key:generate_key({rsa, 2048, 65537}), - Key1 = Key#'RSAPrivateKey'{version = 'two-prime'}, - jose_jwk:from_key(Key1). -%% jose_jwk:generate_key({rsa, 2048}). --else. generate_key() -> jose_jwk:generate_key({ec, secp256r1}). --endif. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%