Commit f20c95b4 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull tpm updates from Jarkko Sakkinen:
 "Mostly TPM and also few keyring fixes"

* tag 'tpmdd-next-v5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd:
  tpm: Add check for Failure mode for TPM2 modules
  tpm: eventlog: Fix section mismatch for DEBUG_SECTION_MISMATCH
  tpm: fix platform_no_drv_owner.cocci warning
  KEYS: asymmetric: enforce SM2 signature use pkey algo
  pkcs7: support EC-RDSA/streebog in SignerInfo
  pkcs7: parser support SM2 and SM3 algorithms combination
  sign-file: Fix confusing error messages
  X.509: Support parsing certificate using SM2 algorithm
  tpm: Add tpm_tis_i2c backend for tpm_tis_core
  tpm: Add tpm_tis_verify_crc to the tpm_tis_phy_ops protocol layer
  dt-bindings: trivial-devices: Add Infineon SLB9673 TPM
  tpm: Add upgrade/reduced mode support for TPM1.2 modules
parents 48a577dc 863ed94c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -141,6 +141,8 @@ properties:
          - infineon,slb9635tt
            # Infineon SLB9645 I2C TPM (new protocol, max 400khz)
          - infineon,slb9645tt
            # Infineon SLB9673 I2C TPM 2.0
          - infineon,slb9673
            # Infineon TLV493D-A1B6 I2C 3D Magnetic Sensor
          - infineon,tlv493d-a1b6
            # Infineon Multi-phase Digital VR Controller xdpe11280
+18 −0
Original line number Diff line number Diff line
@@ -248,6 +248,15 @@ int pkcs7_sig_note_digest_algo(void *context, size_t hdrlen,
	case OID_sha224:
		ctx->sinfo->sig->hash_algo = "sha224";
		break;
	case OID_sm3:
		ctx->sinfo->sig->hash_algo = "sm3";
		break;
	case OID_gost2012Digest256:
		ctx->sinfo->sig->hash_algo = "streebog256";
		break;
	case OID_gost2012Digest512:
		ctx->sinfo->sig->hash_algo = "streebog512";
		break;
	default:
		printk("Unsupported digest algo: %u\n", ctx->last_oid);
		return -ENOPKG;
@@ -277,6 +286,15 @@ int pkcs7_sig_note_pkey_algo(void *context, size_t hdrlen,
		ctx->sinfo->sig->pkey_algo = "ecdsa";
		ctx->sinfo->sig->encoding = "x962";
		break;
	case OID_SM2_with_SM3:
		ctx->sinfo->sig->pkey_algo = "sm2";
		ctx->sinfo->sig->encoding = "raw";
		break;
	case OID_gost2012PKey256:
	case OID_gost2012PKey512:
		ctx->sinfo->sig->pkey_algo = "ecrdsa";
		ctx->sinfo->sig->encoding = "raw";
		break;
	default:
		printk("Unsupported pkey algo: %u\n", ctx->last_oid);
		return -ENOPKG;
+5 −2
Original line number Diff line number Diff line
@@ -304,6 +304,10 @@ static int cert_sig_digest_update(const struct public_key_signature *sig,

	BUG_ON(!sig->data);

	/* SM2 signatures always use the SM3 hash algorithm */
	if (!sig->hash_algo || strcmp(sig->hash_algo, "sm3") != 0)
		return -EINVAL;

	ret = sm2_compute_z_digest(tfm_pkey, SM2_DEFAULT_USERID,
					SM2_DEFAULT_USERID_LEN, dgst);
	if (ret)
@@ -414,8 +418,7 @@ int public_key_verify_signature(const struct public_key *pkey,
	if (ret)
		goto error_free_key;

	if (sig->pkey_algo && strcmp(sig->pkey_algo, "sm2") == 0 &&
	    sig->data_size) {
	if (strcmp(pkey->pkey_algo, "sm2") == 0 && sig->data_size) {
		ret = cert_sig_digest_update(sig, tfm);
		if (ret)
			goto error_free_key;
+3 −0
Original line number Diff line number Diff line
@@ -508,6 +508,9 @@ int x509_extract_key_data(void *context, size_t hdrlen,
	case OID_gost2012PKey512:
		ctx->cert->pub->pkey_algo = "ecrdsa";
		break;
	case OID_sm2:
		ctx->cert->pub->pkey_algo = "sm2";
		break;
	case OID_id_ecPublicKey:
		if (parse_OID(ctx->params, ctx->params_size, &oid) != 0)
			return -EBADMSG;
+12 −0
Original line number Diff line number Diff line
@@ -74,6 +74,18 @@ config TCG_TIS_SPI_CR50
	  If you have a H1 secure module running Cr50 firmware on SPI bus,
	  say Yes and it will be accessible from within Linux.

config TCG_TIS_I2C
	tristate "TPM Interface Specification 1.3 Interface / TPM 2.0 FIFO Interface - (I2C - generic)"
	depends on I2C
	select CRC_CCITT
	select TCG_TIS_CORE
	help
	  If you have a TPM security chip, compliant with the TCG TPM PTP
	  (I2C interface) specification and connected to an I2C bus master,
	  say Yes and it will be accessible from within Linux.
	  To compile this driver as a module, choose M here;
	  the module will be called tpm_tis_i2c.

config TCG_TIS_SYNQUACER
	tristate "TPM Interface Specification 1.2 Interface / TPM 2.0 FIFO Interface (MMIO - SynQuacer)"
	depends on ARCH_SYNQUACER || COMPILE_TEST
Loading