From e37cd21724bd17a469db079ebd0ea3632930cb00 Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Mon, 12 Jun 2023 14:44:06 +0100 Subject: [PATCH] We aren't supporting PSS for now. (#93) RSA PSS isn't really deployed in the WebPKI, and with the recent interest in post-quantum crypto it seems unlikely a new RSA padding mode will be specified. Let's not allude to trying to support it. --- Sources/X509/CertificatePublicKey.swift | 3 ++- Sources/X509/X509BaseTypes/AlgorithmIdentifier.swift | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/X509/CertificatePublicKey.swift b/Sources/X509/CertificatePublicKey.swift index 15c6288..1b9fcb4 100644 --- a/Sources/X509/CertificatePublicKey.swift +++ b/Sources/X509/CertificatePublicKey.swift @@ -135,7 +135,8 @@ extension Certificate.PublicKey { case .p521(let p521): return p521.isValidSignature(signature, for: digest) case .rsa(let rsa): - // TODO: Extend for PSS? + // For now we don't support RSA PSS, as it's not deployed in the WebPKI. + // We could, if there are sufficient user needs. do { let padding = try _RSA.Signing.Padding(forSignatureAlgorithm: signatureAlgorithm) return rsa.isValidSignature(signature, for: digest, padding: padding) diff --git a/Sources/X509/X509BaseTypes/AlgorithmIdentifier.swift b/Sources/X509/X509BaseTypes/AlgorithmIdentifier.swift index a156301..8f31763 100644 --- a/Sources/X509/X509BaseTypes/AlgorithmIdentifier.swift +++ b/Sources/X509/X509BaseTypes/AlgorithmIdentifier.swift @@ -211,7 +211,6 @@ extension AlgorithmIdentifier: CustomStringConvertible { } } -// TODO(cory): We need representations for RSA-PSS. See RFC 4055 for descriptions of the ASN.1. // Relevant note: the PKCS1v1.5 versions need to treat having no parameters and a NULL parameters as identical. This is probably general, // so we may need a custom equatable implementation there.