Commit f3021aca authored by Matt Caswell's avatar Matt Caswell
Browse files

Allow the ca application to use EdDSA

Using the ca application to sign certificates with EdDSA failed because it
is not possible to set the digest to "null". This adds the capability and
updates the documentation accordingly.

Fixes #6201

Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6286)
parent 8a59c085
Loading
Loading
Loading
Loading
+4
Changes for apps/ca.c: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -735,6 +735,9 @@ end_of_options:
    if (md == NULL && (md = lookup_conf(conf, section, ENV_DEFAULT_MD)) == NULL)
        goto end;

    if (strcmp(md, "null") == 0) {
        dgst = EVP_md_null();
    } else {
        if (strcmp(md, "default") == 0) {
            int def_nid;
            if (EVP_PKEY_get_default_digest_nid(pkey, &def_nid) <= 0) {
@@ -747,6 +750,7 @@ end_of_options:
        if (!opt_md(md, &dgst)) {
            goto end;
        }
    }

    if (req) {
        if (email_dn == 1) {
+1 −1
Changes for crypto/ec/ecx_meth.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -778,7 +778,7 @@ static int pkey_ecd_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
    switch (type) {
    case EVP_PKEY_CTRL_MD:
        /* Only NULL allowed as digest */
        if (p2 == NULL)
        if (p2 == NULL || (const EVP_MD *)p2 == EVP_md_null())
            return 1;
        ECerr(EC_F_PKEY_ECD_CTRL, EC_R_INVALID_DIGEST_TYPE);
        return 0;
+2 −1
Changes for doc/man1/ca.pod: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -184,7 +184,8 @@ The number of days to certify the certificate for.
=item B<-md alg>

The message digest to use.
Any digest supported by the OpenSSL B<dgst> command can be used.
Any digest supported by the OpenSSL B<dgst> command can be used. If the signing
key is using Ed25519 or Ed448 then you should specify "null" for the digest.
This option also applies to CRLs.

=item B<-policy arg>