Commit 174fdc93 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull crypto fixes from Herbert Xu:
 "This fixes a regression that broke iwd as well as a divide by zero in
  iaa"

* tag 'v6.9-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: iaa - Fix nr_cpus < nr_iaa case
  Revert "crypto: pkcs7 - remove sha1 support"
parents 4cece764 5a7e89d3
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -75,6 +75,9 @@ int mscode_note_digest_algo(void *context, size_t hdrlen,

	oid = look_up_OID(value, vlen);
	switch (oid) {
	case OID_sha1:
		ctx->digest_algo = "sha1";
		break;
	case OID_sha256:
		ctx->digest_algo = "sha256";
		break;
+4 −0
Original line number Diff line number Diff line
@@ -227,6 +227,9 @@ int pkcs7_sig_note_digest_algo(void *context, size_t hdrlen,
	struct pkcs7_parse_context *ctx = context;

	switch (ctx->last_oid) {
	case OID_sha1:
		ctx->sinfo->sig->hash_algo = "sha1";
		break;
	case OID_sha256:
		ctx->sinfo->sig->hash_algo = "sha256";
		break;
@@ -278,6 +281,7 @@ int pkcs7_sig_note_pkey_algo(void *context, size_t hdrlen,
		ctx->sinfo->sig->pkey_algo = "rsa";
		ctx->sinfo->sig->encoding = "pkcs1";
		break;
	case OID_id_ecdsa_with_sha1:
	case OID_id_ecdsa_with_sha224:
	case OID_id_ecdsa_with_sha256:
	case OID_id_ecdsa_with_sha384:
+2 −1
Original line number Diff line number Diff line
@@ -115,7 +115,8 @@ software_key_determine_akcipher(const struct public_key *pkey,
		 */
		if (!hash_algo)
			return -EINVAL;
		if (strcmp(hash_algo, "sha224") != 0 &&
		if (strcmp(hash_algo, "sha1") != 0 &&
		    strcmp(hash_algo, "sha224") != 0 &&
		    strcmp(hash_algo, "sha256") != 0 &&
		    strcmp(hash_algo, "sha384") != 0 &&
		    strcmp(hash_algo, "sha512") != 0 &&
+1 −1
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ EXPORT_SYMBOL_GPL(decrypt_blob);
 * Sign the specified data blob using the private key specified by params->key.
 * The signature is wrapped in an encoding if params->encoding is specified
 * (eg. "pkcs1").  If the encoding needs to know the digest type, this can be
 * passed through params->hash_algo (eg. "sha512").
 * passed through params->hash_algo (eg. "sha1").
 *
 * Returns the length of the data placed in the signature buffer or an error.
 */
+8 −0
Original line number Diff line number Diff line
@@ -198,6 +198,10 @@ int x509_note_sig_algo(void *context, size_t hdrlen, unsigned char tag,
	default:
		return -ENOPKG; /* Unsupported combination */

	case OID_sha1WithRSAEncryption:
		ctx->cert->sig->hash_algo = "sha1";
		goto rsa_pkcs1;

	case OID_sha256WithRSAEncryption:
		ctx->cert->sig->hash_algo = "sha256";
		goto rsa_pkcs1;
@@ -214,6 +218,10 @@ int x509_note_sig_algo(void *context, size_t hdrlen, unsigned char tag,
		ctx->cert->sig->hash_algo = "sha224";
		goto rsa_pkcs1;

	case OID_id_ecdsa_with_sha1:
		ctx->cert->sig->hash_algo = "sha1";
		goto ecdsa;

	case OID_id_rsassa_pkcs1_v1_5_with_sha3_256:
		ctx->cert->sig->hash_algo = "sha3-256";
		goto rsa_pkcs1;
Loading