From b82448d873dbd8841450afb70f73ddb96ebe7e52 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Tue, 7 Feb 2023 17:05:38 +0700 Subject: Fix serial number comparison --- crypto/src/pkix/PkixNameConstraintValidator.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/src/pkix/PkixNameConstraintValidator.cs b/crypto/src/pkix/PkixNameConstraintValidator.cs index 7a9e3f45e..85dac857b 100644 --- a/crypto/src/pkix/PkixNameConstraintValidator.cs +++ b/crypto/src/pkix/PkixNameConstraintValidator.cs @@ -79,8 +79,8 @@ namespace Org.BouncyCastle.Pkix // obey RFC 5280 7.1 // special treatment of serialNumber for GSMA SGP.22 RSP specification if (subtreeRdn.Count == 1 && dnsRdn.Count == 1 - && subtreeRdn.GetFirst().GetType().Equals(SerialNumberOid) - && dnsRdn.GetFirst().GetType().Equals(SerialNumberOid)) + && SerialNumberOid.Equals(subtreeRdn.GetFirst().Type) + && SerialNumberOid.Equals(dnsRdn.GetFirst().Type)) { if (!Platform.StartsWith(dnsRdn.GetFirst().Value.ToString(), subtreeRdn.GetFirst().Value.ToString())) return false; -- cgit 1.4.1