{
int padding, mgf, len;
enum wc_HashType hash;
+ chunk_t label = chunk_empty;
+
+ if (params)
+ {
+ label = *(chunk_t *)params;
+ }
switch (scheme)
{
len = wc_RsaEncryptSize(&this->rsa);
*plain = chunk_alloc(len);
len = wc_RsaPrivateDecrypt_ex(crypto.ptr, crypto.len, plain->ptr, len,
- &this->rsa, padding, hash, mgf, NULL, 0);
+ &this->rsa, padding, hash, mgf,
+ label.ptr, label.len);
if (len < 0)
{
DBG1(DBG_LIB, "RSA decryption failed");
{
int padding, mgf, len;
enum wc_HashType hash;
+ chunk_t label = chunk_empty;
+
+ if (params)
+ {
+ label = *(chunk_t *)params;
+ }
switch (scheme)
{
*crypto = chunk_alloc(len);
len = wc_RsaPublicEncrypt_ex(plain.ptr, plain.len, crypto->ptr, len,
&this->rsa, &this->rng, padding, hash, mgf,
- NULL, 0);
+ label.ptr, label.len);
if (len < 0)
{
DBG1(DBG_LIB, "RSA encryption failed");