Linux cryptographic layer development
 help / color / mirror / Atom feed
* [PATCH 0/2] pkcs7: better handling of signed attributes
@ 2025-11-25 19:02 James Bottomley
  2025-11-25 19:02 ` [PATCH 1/2] crypto: pkcs7: add ability to extract signed attributes by OID James Bottomley
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: James Bottomley @ 2025-11-25 19:02 UTC (permalink / raw)
  To: linux-crypto; +Cc: David Howells, Blaise Boscaccy

Although the biggest use of signed attributes is PKCS#7 and X509
specific data, they can be added to a signature to support arbitrary
and verifiable objects.  This makes them particularly useful when you
want to take an existing signature scheme and extend it with
additional (but always verified) data in such a way that it still
looks valid to both the old and new schemes.

The first patch in this series is the implementation that allows
extraction of arbitrary signed attributes by OID.  Since our
predominant use case is single signing, the search just stops when it
finds any authenticated attribute matching the OID. The second patch
uses the pkcs7 test module key type to validate that the code is
working (it looks for the message digest OID which must be present).
I think it's a useful illustration of how this works, but it doesn't
have to go upstream.

Regards,

James


James Bottomley (2):
  crypto: pkcs7: add ability to extract signed attributes by OID
  crypto: pkcs7: add tests for pkcs7_get_authattr

 crypto/asymmetric_keys/Makefile         |  4 +-
 crypto/asymmetric_keys/pkcs7_aa.asn1    | 18 ++++++
 crypto/asymmetric_keys/pkcs7_key_type.c | 27 +++++++-
 crypto/asymmetric_keys/pkcs7_parser.c   | 84 +++++++++++++++++++++++++
 include/crypto/pkcs7.h                  |  4 ++
 5 files changed, 135 insertions(+), 2 deletions(-)
 create mode 100644 crypto/asymmetric_keys/pkcs7_aa.asn1

-- 
2.51.0


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

end of thread, other threads:[~2025-11-26 17:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-25 19:02 [PATCH 0/2] pkcs7: better handling of signed attributes James Bottomley
2025-11-25 19:02 ` [PATCH 1/2] crypto: pkcs7: add ability to extract signed attributes by OID James Bottomley
2025-11-25 20:39   ` David Howells
2025-11-25 22:18     ` James Bottomley
2025-11-25 19:02 ` [PATCH 2/2] crypto: pkcs7: add tests for pkcs7_get_authattr James Bottomley
2025-11-25 20:41   ` David Howells
2025-11-26 17:45 ` [PATCH 0/2] pkcs7: better handling of signed attributes James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox