]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - crypto/asymmetric_keys/pkcs7_verify.c
Merge tag 'mac80211-for-davem-2017-12-19' of git://git.kernel.org/pub/scm/linux/kerne...
[mirror_ubuntu-bionic-kernel.git] / crypto / asymmetric_keys / pkcs7_verify.c
index 2d93d9eccb4d0c46d7b93306f50f590709d1b21f..39e6de0c2761fb03efab8f144fa1d1693e7cb035 100644 (file)
@@ -59,11 +59,8 @@ static int pkcs7_digest(struct pkcs7_message *pkcs7,
        desc->flags = CRYPTO_TFM_REQ_MAY_SLEEP;
 
        /* Digest the message [RFC2315 9.3] */
-       ret = crypto_shash_init(desc);
-       if (ret < 0)
-               goto error;
-       ret = crypto_shash_finup(desc, pkcs7->data, pkcs7->data_len,
-                                sig->digest);
+       ret = crypto_shash_digest(desc, pkcs7->data, pkcs7->data_len,
+                                 sig->digest);
        if (ret < 0)
                goto error;
        pr_devel("MsgDigest = [%*ph]\n", 8, sig->digest);
@@ -150,7 +147,7 @@ static int pkcs7_find_key(struct pkcs7_message *pkcs7,
                pr_devel("Sig %u: Found cert serial match X.509[%u]\n",
                         sinfo->index, certix);
 
-               if (x509->pub->pkey_algo != sinfo->sig->pkey_algo) {
+               if (strcmp(x509->pub->pkey_algo, sinfo->sig->pkey_algo) != 0) {
                        pr_warn("Sig %u: X.509 algo and PKCS#7 sig algo don't match\n",
                                sinfo->index);
                        continue;