integrity: convert digsig to akcipher api
authorTadeusz Struk <tadeusz.struk@intel.com>
Tue, 2 Feb 2016 18:08:58 +0000 (10:08 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 6 Feb 2016 07:33:26 +0000 (15:33 +0800)
Convert asymmetric_verify to akcipher api.

Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
security/integrity/Kconfig
security/integrity/digsig_asymmetric.c

index 21d756832b754322f71722f6b0857294e1a5ffd2..5533a011b58e17128913877f567043b89a0081c5 100644 (file)
@@ -36,6 +36,7 @@ config INTEGRITY_ASYMMETRIC_KEYS
         select ASYMMETRIC_KEY_TYPE
         select ASYMMETRIC_PUBLIC_KEY_SUBTYPE
         select PUBLIC_KEY_ALGO_RSA
+        select CRYPTO_RSA
         select X509_CERTIFICATE_PARSER
        help
          This option enables digital signature verification using
index 5ade2a7517a6341305ba4aafbb18469cd1ed8db8..2fa3bc681a1ba000e371bf85f3fcceafe1c84a3e 100644 (file)
@@ -106,13 +106,9 @@ int asymmetric_verify(struct key *keyring, const char *sig,
        pks.pkey_hash_algo = hdr->hash_algo;
        pks.digest = (u8 *)data;
        pks.digest_size = datalen;
-       pks.nr_mpi = 1;
-       pks.rsa.s = mpi_read_raw_data(hdr->sig, siglen);
-
-       if (pks.rsa.s)
-               ret = verify_signature(key, &pks);
-
-       mpi_free(pks.rsa.s);
+       pks.s = hdr->sig;
+       pks.s_size = siglen;
+       ret = verify_signature(key, &pks);
        key_put(key);
        pr_debug("%s() = %d\n", __func__, ret);
        return ret;