Skip to content

Commit

Permalink
OpenSSL 3: Restore compat with OpenSSL 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
glts committed Jan 2, 2023
1 parent a8d336b commit 17f3749
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion libopendkim/dkim-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ dkim_test_key(DKIM_LIB *lib, char *selector, char *domain,
return -1;
}

crypto->crypto_keysize = EVP_PKEY_get_size(crypto->crypto_pkey);
crypto->crypto_keysize = EVP_PKEY_size(crypto->crypto_pkey);

outkey = BIO_new(BIO_s_mem());
if (outkey == NULL)
Expand Down
10 changes: 5 additions & 5 deletions libopendkim/dkim.c
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,7 @@ dkim_privkey_load(DKIM *dkim)
}
}

crypto->crypto_outlen = EVP_PKEY_get_size(crypto->crypto_pkey);
crypto->crypto_outlen = EVP_PKEY_size(crypto->crypto_pkey);
crypto->crypto_keysize = crypto->crypto_outlen * 8;

crypto->crypto_out = DKIM_MALLOC(dkim, crypto->crypto_outlen);
Expand Down Expand Up @@ -5793,7 +5793,7 @@ dkim_sig_process(DKIM *dkim, DKIM_SIGINFO *sig)
{
EVP_MD_CTX *md_ctx;

if (EVP_PKEY_get_id(crypto->crypto_pkey) != EVP_PKEY_ED25519)
if (EVP_PKEY_id(crypto->crypto_pkey) != EVP_PKEY_ED25519)
{
dkim_error(dkim,
"s=%s d=%s: not an ED25519 key",
Expand Down Expand Up @@ -5847,12 +5847,12 @@ dkim_sig_process(DKIM *dkim, DKIM_SIGINFO *sig)

EVP_MD_CTX_free(md_ctx);

crypto->crypto_keysize = EVP_PKEY_get_size(crypto->crypto_pkey);
crypto->crypto_keysize = EVP_PKEY_size(crypto->crypto_pkey);
}
else
# endif /* HAVE_ED25519 */
{
if (EVP_PKEY_get_base_id(crypto->crypto_pkey) != EVP_PKEY_RSA)
if (EVP_PKEY_base_id(crypto->crypto_pkey) != EVP_PKEY_RSA)
{
dkim_error(dkim,
"s=%s d=%s: not an RSA key",
Expand All @@ -5866,7 +5866,7 @@ dkim_sig_process(DKIM *dkim, DKIM_SIGINFO *sig)
return DKIM_STAT_OK;
}

crypto->crypto_keysize = EVP_PKEY_get_size(crypto->crypto_pkey);
crypto->crypto_keysize = EVP_PKEY_size(crypto->crypto_pkey);

crypto->crypto_in = sig->sig_sig;
crypto->crypto_inlen = sig->sig_siglen;
Expand Down
2 changes: 1 addition & 1 deletion opendkim/opendkim-genzone.c
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ main(int argc, char **argv)
}
}

if (EVP_PKEY_get_base_id(pkey) != EVP_PKEY_RSA)
if (EVP_PKEY_base_id(pkey) != EVP_PKEY_RSA)
{
fprintf(stderr, "%s: not an RSA key\n", progname);
(void) dkimf_db_close(db);
Expand Down

0 comments on commit 17f3749

Please sign in to comment.