Skip to content

Commit

Permalink
Revert RSASSA-PSS parameters (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
voltone authored Aug 5, 2020
1 parent 334c5dd commit eb55ca4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
12 changes: 2 additions & 10 deletions lib/plug_signature/crypto.ex
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ defmodule PlugSignature.Crypto do
"""
def verify!(payload, "hs2019", signature, rsa_public_key(publicExponent: e, modulus: n)) do
# Use PSS padding; requires workaround for https://bugs.erlang.org/browse/ERL-878
:crypto.verify(:rsa, :sha512, payload, signature, [e, n],
rsa_padding: :rsa_pkcs1_pss_padding,
rsa_pss_saltlen: 94,
rsa_mgf1_md: :sha256
)
:crypto.verify(:rsa, :sha512, payload, signature, [e, n], rsa_padding: :rsa_pkcs1_pss_padding)
end

def verify!(payload, "hs2019", signature, {_point, _ecpk_parameters} = public_key) do
Expand Down Expand Up @@ -114,11 +110,7 @@ defmodule PlugSignature.Crypto do
"""
def sign!(payload, "hs2019", rsa_private_key(publicExponent: e, modulus: n, privateExponent: d)) do
# Use PSS padding; requires workaround for https://bugs.erlang.org/browse/ERL-878
:crypto.sign(:rsa, :sha512, payload, [e, n, d],
rsa_padding: :rsa_pkcs1_pss_padding,
rsa_pss_saltlen: 94,
rsa_mgf1_md: :sha256
)
:crypto.sign(:rsa, :sha512, payload, [e, n, d], rsa_padding: :rsa_pkcs1_pss_padding)
end

def sign!(payload, "hs2019", ec_private_key() = private_key) do
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule PlugSignature.MixProject do
use Mix.Project

@version "0.6.0"
@version "0.7.0"

def project do
[
Expand Down

0 comments on commit eb55ca4

Please sign in to comment.