Skip to content

Commit 8d423c2

Browse files
committed
rsa: Add more OAEP support from v1.1.0
Introduced in OpenSSL commit 211a14f6279f127f7a5a59948819bd939131b0b6 (v1.1.0).
1 parent 1a843bd commit 8d423c2

File tree

1 file changed

+14
-0
lines changed
  • source/deimos/openssl

1 file changed

+14
-0
lines changed

source/deimos/openssl/rsa.d

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,18 @@ static if (OPENSSL_VERSION_AT_LEAST(1, 1, 0))
334334
return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT,
335335
EVP_PKEY_CTRL_RSA_OAEP_LABEL, len, label);
336336
}
337+
338+
auto EVP_PKEY_CTX_get_rsa_oaep_md () (EVP_PKEY_CTX* ctx, EVP_MD** pmd)
339+
{
340+
return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT,
341+
EVP_PKEY_CTRL_GET_RSA_OAEP_MD, 0, pmd);
342+
}
343+
344+
auto EVP_PKEY_CTX_get0_rsa_oaep_label () (EVP_PKEY_CTX* ctx, ubyte** label)
345+
{
346+
return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT,
347+
EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL, 0, label);
348+
}
337349
}
338350

339351

@@ -352,6 +364,8 @@ static if (OPENSSL_VERSION_AT_LEAST(1, 1, 0))
352364
{
353365
enum EVP_PKEY_CTRL_RSA_OAEP_MD = (EVP_PKEY_ALG_CTRL + 9);
354366
enum EVP_PKEY_CTRL_RSA_OAEP_LABEL = (EVP_PKEY_ALG_CTRL + 10);
367+
enum EVP_PKEY_CTRL_GET_RSA_OAEP_MD = (EVP_PKEY_ALG_CTRL + 11);
368+
enum EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL = (EVP_PKEY_ALG_CTRL + 12);
355369
}
356370

357371
static if (OPENSSL_VERSION_AT_LEAST(1, 1, 1))

0 commit comments

Comments
 (0)