]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
certificate_t.has_subject() matches for certificate serialNumber
authorMartin Willi <martin@revosec.ch>
Tue, 27 Nov 2012 09:02:37 +0000 (10:02 +0100)
committerMartin Willi <martin@revosec.ch>
Wed, 19 Dec 2012 09:32:07 +0000 (10:32 +0100)
src/libstrongswan/plugins/openssl/openssl_x509.c
src/libstrongswan/plugins/x509/x509_cert.c

index b847c0a636c64f396e8008adcce0eeabfb120416..676b97f7a63e924d669f3513237689697fe8985f 100644 (file)
@@ -327,6 +327,10 @@ METHOD(certificate_t, has_subject, id_match_t,
                {
                        return ID_MATCH_PERFECT;
                }
+               if (chunk_equals(get_serial(this), encoding))
+               {
+                       return ID_MATCH_PERFECT;
+               }
        }
        best = this->subject->matches(this->subject, subject);
        enumerator = create_subjectAltName_enumerator(this);
index c93b83befc7b4d68b40605ec26045c140e5d7daa..85c48155299554133699bb142c37f6757e13e823 100644 (file)
@@ -1547,6 +1547,10 @@ METHOD(certificate_t, has_subject, id_match_t,
                {
                        return ID_MATCH_PERFECT;
                }
+               if (chunk_equals(this->serialNumber, encoding))
+               {
+                       return ID_MATCH_PERFECT;
+               }
        }
        best = this->subject->matches(this->subject, subject);
        enumerator = this->subjectAltNames->create_enumerator(this->subjectAltNames);