From 6e48708a748acc9be0b904c949931102568ec23c Mon Sep 17 00:00:00 2001 From: Jacob Hoffman-Andrews Date: Wed, 25 Mar 2015 18:56:00 -0700 Subject: [PATCH] Add comment about PSSOptions to jws.go. --- jose/jws.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jose/jws.go b/jose/jws.go index 2aab603e3..63a4b1ad9 100644 --- a/jose/jws.go +++ b/jose/jws.go @@ -190,6 +190,8 @@ func Sign(alg JoseAlgorithm, privateKey interface{}, payload []byte) (JsonWebSig if rsaPriv == nil { return zero, errors.New(fmt.Sprintf("Algorithm %s requres RSA private key", jws.Header.Algorithm)) } + // Contrary to docs, you can't pass a nil instead of the PSSOptions; You'll + // get a nil dereference. sig, err = rsa.SignPSS(rand.Reader, rsaPriv, hashID, inputHash, &rsa.PSSOptions{}) case "E": if ecPriv == nil {