botan: RSA OAEP labels are not supported
This commit is contained in:
@@ -162,6 +162,7 @@ METHOD(private_key_t, decrypt, bool,
|
|||||||
void *params, chunk_t crypto, chunk_t *plain)
|
void *params, chunk_t crypto, chunk_t *plain)
|
||||||
{
|
{
|
||||||
botan_pk_op_decrypt_t decrypt_op;
|
botan_pk_op_decrypt_t decrypt_op;
|
||||||
|
chunk_t label = chunk_empty;
|
||||||
const char *padding;
|
const char *padding;
|
||||||
|
|
||||||
switch (scheme)
|
switch (scheme)
|
||||||
@@ -190,6 +191,16 @@ METHOD(private_key_t, decrypt, bool,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (scheme != ENCRYPT_RSA_PKCS1 && params != NULL)
|
||||||
|
{
|
||||||
|
label = *(chunk_t *)params;
|
||||||
|
if (label.len > 0)
|
||||||
|
{
|
||||||
|
DBG1(DBG_LIB, "RSA OAEP decryption with a label not supported");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (botan_pk_op_decrypt_create(&decrypt_op, this->key, padding, 0))
|
if (botan_pk_op_decrypt_create(&decrypt_op, this->key, padding, 0))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ METHOD(public_key_t, encrypt, bool,
|
|||||||
{
|
{
|
||||||
botan_pk_op_encrypt_t encrypt_op;
|
botan_pk_op_encrypt_t encrypt_op;
|
||||||
botan_rng_t rng;
|
botan_rng_t rng;
|
||||||
|
chunk_t label = chunk_empty;
|
||||||
const char* padding;
|
const char* padding;
|
||||||
|
|
||||||
switch (scheme)
|
switch (scheme)
|
||||||
@@ -171,6 +172,16 @@ METHOD(public_key_t, encrypt, bool,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (scheme != ENCRYPT_RSA_PKCS1 && params != NULL)
|
||||||
|
{
|
||||||
|
label = *(chunk_t *)params;
|
||||||
|
if (label.len > 0)
|
||||||
|
{
|
||||||
|
DBG1(DBG_LIB, "RSA OAEP encryption with a label not supported");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!botan_get_rng(&rng, RNG_STRONG))
|
if (!botan_get_rng(&rng, RNG_STRONG))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|||||||
Reference in New Issue
Block a user