aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_x509cert.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/openssl/ossl_x509cert.c')
-rw-r--r--ext/openssl/ossl_x509cert.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/openssl/ossl_x509cert.c b/ext/openssl/ossl_x509cert.c
index dbf83ff5..846dd070 100644
--- a/ext/openssl/ossl_x509cert.c
+++ b/ext/openssl/ossl_x509cert.c
@@ -539,7 +539,11 @@ ossl_x509_sign(VALUE self, VALUE key, VALUE digest)
const EVP_MD *md;
pkey = GetPrivPKeyPtr(key); /* NO NEED TO DUP */
- md = ossl_evp_get_digestbyname(digest);
+ if (NIL_P(digest)) {
+ md = NULL; /* needed for some key types, e.g. Ed25519 */
+ } else {
+ md = ossl_evp_get_digestbyname(digest);
+ }
GetX509(self, x509);
if (!X509_sign(x509, pkey, md)) {
ossl_raise(eX509CertError, NULL);