]> git.ipfire.org Git - people/ms/strongswan.git/blobdiff - src/libstrongswan/plugins/botan/botan_rsa_public_key.c
botan: RSA OAEP labels are not supported
[people/ms/strongswan.git] / src / libstrongswan / plugins / botan / botan_rsa_public_key.c
index 684727da701bf1cdcd5e6746b5acc69855b09458..3f60f15a15af45d6cf2261299067233e889db7a2 100644 (file)
@@ -143,6 +143,7 @@ METHOD(public_key_t, encrypt, bool,
 {
        botan_pk_op_encrypt_t encrypt_op;
        botan_rng_t rng;
+       chunk_t label = chunk_empty;
        const char* padding;
 
        switch (scheme)
@@ -171,6 +172,16 @@ METHOD(public_key_t, encrypt, bool,
                        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))
        {
                return FALSE;