summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2016-02-09 16:18:01 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2016-02-09 16:18:01 +0800
commitf75516a81548074be331b3e41d2e3f448d1f8b8d (patch)
treeba6e557c7473389709cf7a3bc69e608dcd8584f2 /security
parented1afac9145c4517a2c84f93e04a35046ea206e3 (diff)
downloadtalos-obmc-linux-f75516a81548074be331b3e41d2e3f448d1f8b8d.tar.gz
talos-obmc-linux-f75516a81548074be331b3e41d2e3f448d1f8b8d.zip
crypto: keys - Revert "convert public key to akcipher api"
This needs to go through the security tree so I'm reverting the patches for now. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'security')
-rw-r--r--security/integrity/Kconfig1
-rw-r--r--security/integrity/digsig_asymmetric.c10
2 files changed, 7 insertions, 4 deletions
diff --git a/security/integrity/Kconfig b/security/integrity/Kconfig
index 5533a011b58e..21d756832b75 100644
--- a/security/integrity/Kconfig
+++ b/security/integrity/Kconfig
@@ -36,7 +36,6 @@ 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
diff --git a/security/integrity/digsig_asymmetric.c b/security/integrity/digsig_asymmetric.c
index 2fa3bc681a1b..5ade2a7517a6 100644
--- a/security/integrity/digsig_asymmetric.c
+++ b/security/integrity/digsig_asymmetric.c
@@ -106,9 +106,13 @@ 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.s = hdr->sig;
- pks.s_size = siglen;
- ret = verify_signature(key, &pks);
+ 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);
key_put(key);
pr_debug("%s() = %d\n", __func__, ret);
return ret;
OpenPOWER on IntegriCloud