linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 00/10] crypto: add EC-RDSA (GOST 34.10) algorithm
@ 2019-02-24  6:08 Vitaly Chikunov
  2019-02-24  6:08 ` [PATCH v5 01/10] KEYS: report to keyctl only actually supported key ops Vitaly Chikunov
                   ` (10 more replies)
  0 siblings, 11 replies; 21+ messages in thread
From: Vitaly Chikunov @ 2019-02-24  6:08 UTC (permalink / raw)
  To: Herbert Xu, David Howells, Mimi Zohar, linux-integrity, keyrings,
	linux-crypto, linux-kernel

This patchset changes akcipher API to support ECDSA style signature
verification, augments x509 parser to make it work with EC-RDSA certificates,
and, finally, implements EC-RDSA (GOST 34.10) signature verification and its
integration with IMA.

Changes since RFC (v1-v4):
- akcipher set_max_size, encrypt, decrypt, sign, verify callbacks may be
  undefined by the drivers, so their crypto_akcipher_* frontends check for
  their presence before passing the call.
- supported_ops flags are set for keyctl, based on the presence of implemented
  akcipher callbacks.
- Transition to verify2 API is abandoned because raw RSA does not need
  sign/verify ops at all, and we can switch to the new verify in one step.
  For this RSA backends have sign/verify ops removed as they should only
  be used (and actually used only) via PKCS1 driver.
- Verify callback requires digest as the input parameter in src SGL, as
  suggested by Herbert Xu, (instead of a separate parameter, as it was in
  verify2).
- For verify op signature is moved into kmalloc'd memory as suggested by
  Herbert Xu.
- set_params API should be called before set_{pub,priv}_key, thus set_*_key
  knows everything it needs to set they key properly. Also, set_params made
  optional for back compatibility with RSA drivers.
- Public-key cryptography section is created in Kconfig.
- ecc.c is made into separate module object, to be used together by ECDH and
  EC-RDSA.
- EC-RDSA parameters and public key are parsed using asn1_ber_decoder as
  suggested by Stephan Mueller and David Howells.
- Test vectors are added and tests are passing.
- Curves/parameters definitions are split from ecrdsa.c into ecrdsa_defs.h.
- Integration with IMA in asymmetric_verify(). Userspace ima-evm-utils already
  have a patch in the queue to support this. Tested on x86_64.

---
Vitaly Chikunov (10):
  KEYS: report to keyctl only actually supported key ops
  crypto: akcipher - check the presence of callback before the call
  crypto: rsa - unimplement sign/verify for raw RSA backends
  crypto: akcipher - new verify API for public key algorithms
  X.509: parse public key parameters from x509 for akcipher
  crypto: Kconfig - create Public-key cryptography section
  crypto: ecc - make ecc into separate module
  crypto: ecrdsa - add EC-RDSA (GOST 34.10) algorithm
  crypto: ecrdsa - add EC-RDSA test vectors to testmgr
  integrity: support EC-RDSA signatures for asymmetric_verify

 crypto/Kconfig                                |  63 ++--
 crypto/Makefile                               |  10 +-
 crypto/asymmetric_keys/asym_tpm.c             |  34 +--
 crypto/asymmetric_keys/public_key.c           |  63 ++--
 crypto/asymmetric_keys/x509.asn1              |   2 +-
 crypto/asymmetric_keys/x509_cert_parser.c     |  57 +++-
 crypto/ecc.c                                  | 417 +++++++++++++++++++++++++-
 crypto/ecc.h                                  | 153 +++++++++-
 crypto/ecc_curve_defs.h                       |  15 -
 crypto/ecrdsa.c                               | 297 ++++++++++++++++++
 crypto/ecrdsa_defs.h                          | 225 ++++++++++++++
 crypto/rsa-pkcs1pad.c                         |  33 +-
 crypto/rsa.c                                  | 109 -------
 crypto/testmgr.c                              |  60 ++--
 crypto/testmgr.h                              | 157 ++++++++++
 drivers/crypto/caam/caampkc.c                 |   2 -
 drivers/crypto/ccp/ccp-crypto-rsa.c           |   2 -
 drivers/crypto/qat/qat_common/qat_asym_algs.c |   2 -
 include/crypto/akcipher.h                     |  97 ++++--
 include/crypto/public_key.h                   |   4 +
 include/linux/oid_registry.h                  |  18 ++
 security/integrity/digsig_asymmetric.c        |   9 +-
 22 files changed, 1545 insertions(+), 284 deletions(-)
 create mode 100644 crypto/ecrdsa.c
 create mode 100644 crypto/ecrdsa_defs.h

-- 
2.11.0


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2019-03-01  2:34 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-24  6:08 [PATCH v5 00/10] crypto: add EC-RDSA (GOST 34.10) algorithm Vitaly Chikunov
2019-02-24  6:08 ` [PATCH v5 01/10] KEYS: report to keyctl only actually supported key ops Vitaly Chikunov
2019-02-24  6:08 ` [PATCH v5 02/10] crypto: akcipher - check the presence of callback before the call Vitaly Chikunov
2019-02-24  6:08 ` [PATCH v5 03/10] crypto: rsa - unimplement sign/verify for raw RSA backends Vitaly Chikunov
2019-02-24  6:08 ` [PATCH v5 04/10] crypto: akcipher - new verify API for public key algorithms Vitaly Chikunov
2019-02-27 23:28   ` Mimi Zohar
2019-02-28  5:37     ` Vitaly Chikunov
2019-02-24  6:08 ` [PATCH v5 05/10] X.509: parse public key parameters from x509 for akcipher Vitaly Chikunov
2019-02-24  6:08 ` [PATCH v5 06/10] crypto: Kconfig - create Public-key cryptography section Vitaly Chikunov
2019-02-24  6:08 ` [PATCH v5 07/10] crypto: ecc - make ecc into separate module Vitaly Chikunov
2019-02-24  6:08 ` [PATCH v5 08/10] crypto: ecrdsa - add EC-RDSA (GOST 34.10) algorithm Vitaly Chikunov
2019-02-24  6:08 ` [PATCH v5 09/10] crypto: ecrdsa - add EC-RDSA test vectors to testmgr Vitaly Chikunov
2019-02-24  6:08 ` [PATCH v5 10/10] integrity: support EC-RDSA signatures for asymmetric_verify Vitaly Chikunov
2019-02-25 21:20   ` Thiago Jung Bauermann
2019-02-26  4:25     ` Vitaly Chikunov
2019-02-26 12:07       ` Mimi Zohar
2019-02-28 18:18 ` [PATCH v5 04/10] crypto: akcipher - new verify API for public key algorithms David Howells
2019-02-28 18:39   ` Vitaly Chikunov
2019-02-28 19:02   ` David Howells
2019-02-28 19:07     ` Vitaly Chikunov
2019-03-01  2:34       ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).