Skip to content

Commit

Permalink
fix FIPS mode
Browse files Browse the repository at this point in the history
  • Loading branch information
qmuntal committed Dec 13, 2024
1 parent 8d39402 commit 34344f7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rsa.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,12 @@ func SupportsSignatureRSAPKCS1v15(ch crypto.Hash) (supported bool) {
}
defer C.go_openssl_EVP_PKEY_CTX_free(ctx)

msg := make([]byte, 1)
var outLen C.size_t
return C.go_openssl_EVP_PKEY_sign_init(ctx) == 1 &&
C.go_openssl_EVP_PKEY_CTX_ctrl(ctx, -1, -1, C.GO_EVP_PKEY_CTRL_MD, 0, unsafe.Pointer(md)) == 1 &&
setRSAPAdding(ctx, C.GO_RSA_PKCS1_PADDING) == nil
setRSAPAdding(ctx, C.GO_RSA_PKCS1_PADDING) == nil &&
C.go_openssl_EVP_PKEY_sign(ctx, nil, &outLen, base(msg), C.size_t(len(msg))) == 1
}

func GenerateKeyRSA(bits int) (N, E, D, P, Q, Dp, Dq, Qinv BigInt, err error) {
Expand Down

0 comments on commit 34344f7

Please sign in to comment.