From 529215370bc33e1aa704ae2628b642a70d04f34a Mon Sep 17 00:00:00 2001 From: "John M. Schanck" Date: Fri, 30 Aug 2024 13:36:04 -0700 Subject: [PATCH] Use rsaEncryption OID for RSA keys --- src/crypto/der.rs | 6 +++--- src/crypto/mod.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/crypto/der.rs b/src/crypto/der.rs index 39c5e0b6..85aed10c 100644 --- a/src/crypto/der.rs +++ b/src/crypto/der.rs @@ -18,9 +18,9 @@ pub const OID_SECP256R1_BYTES: &[u8] = &[ 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, ]; pub const OID_ED25519_BYTES: &[u8] = &[/* RFC 8410 (id-ed25519) */ 0x2b, 0x65, 0x70]; -pub const OID_RS256_BYTES: &[u8] = &[ - /* RFC 4055 (sha256WithRSAEncryption) */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, +pub const OID_RSA_ENCRYPTION_BYTES: &[u8] = &[ + /* RFC 4055 (rsaEncryption) */ + 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, ]; pub type Result = std::result::Result; diff --git a/src/crypto/mod.rs b/src/crypto/mod.rs index a86dac82..084a28df 100644 --- a/src/crypto/mod.rs +++ b/src/crypto/mod.rs @@ -823,7 +823,7 @@ impl COSERSAKey { // algorithm: AlgorithmIdentifier &der::sequence(&[ // algorithm - &der::object_id(der::OID_RS256_BYTES)?, + &der::object_id(der::OID_RSA_ENCRYPTION_BYTES)?, // parameters &der::null()?, ])?,