From c6f976fb582940b476e60463a6a0e9b9fdb71fb0 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Sun, 14 Oct 2018 19:50:46 +0700 Subject: Move generic "...withRSA" handler after PSSwithRSA --- crypto/src/security/SignerUtilities.cs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'crypto/src') diff --git a/crypto/src/security/SignerUtilities.cs b/crypto/src/security/SignerUtilities.cs index dc31ae464..ae8d21f0a 100644 --- a/crypto/src/security/SignerUtilities.cs +++ b/crypto/src/security/SignerUtilities.cs @@ -517,14 +517,6 @@ namespace Org.BouncyCastle.Security { return (new RsaDigestSigner(new NullDigest(), (AlgorithmIdentifier)null)); } - - if (Platform.EndsWith(mechanism, "withRSA")) - { - string digestName = mechanism.Substring(0, mechanism.LastIndexOf("with")); - IDigest digest = DigestUtilities.GetDigest(digestName); - return new RsaDigestSigner(digest); - } - if (mechanism.Equals("RAWRSASSA-PSS")) { // TODO Add support for other parameter settings @@ -536,7 +528,12 @@ namespace Org.BouncyCastle.Security // to be used can be overridden by subsequent parameter settings. return (new PssSigner(new RsaBlindedEngine(), new Sha1Digest())); } - + if (Platform.EndsWith(mechanism, "withRSA")) + { + string digestName = mechanism.Substring(0, mechanism.LastIndexOf("with")); + IDigest digest = DigestUtilities.GetDigest(digestName); + return new RsaDigestSigner(digest); + } if (Platform.EndsWith(mechanism, "withRSAandMGF1")) { string digestName = mechanism.Substring(0, mechanism.LastIndexOf("with")); -- cgit 1.5.1