summaryrefslogtreecommitdiff
path: root/src/libstrongswan/plugins/pubkey/pubkey_cert.c
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2013-08-25 15:37:27 +0200
committerYves-Alexis Perez <corsac@debian.org>2013-08-25 15:37:27 +0200
commitc7307e752d8f47c68f834e22ee2ce0a14a70e695 (patch)
treefbb442a20ab54aad511b46a070e65b8d09c22791 /src/libstrongswan/plugins/pubkey/pubkey_cert.c
parentf74c6d77c3efb529e7403eeef0613c061eb895b3 (diff)
parent6b99c8d9cff7b3e8ae8f3204b99e7ea40f791349 (diff)
downloadvyos-strongswan-c7307e752d8f47c68f834e22ee2ce0a14a70e695.tar.gz
vyos-strongswan-c7307e752d8f47c68f834e22ee2ce0a14a70e695.zip
Merge tag 'upstream/5.1.0'
Upstream version 5.1.0
Diffstat (limited to 'src/libstrongswan/plugins/pubkey/pubkey_cert.c')
-rw-r--r--src/libstrongswan/plugins/pubkey/pubkey_cert.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/libstrongswan/plugins/pubkey/pubkey_cert.c b/src/libstrongswan/plugins/pubkey/pubkey_cert.c
index 95f53f919..b7ba5ad43 100644
--- a/src/libstrongswan/plugins/pubkey/pubkey_cert.c
+++ b/src/libstrongswan/plugins/pubkey/pubkey_cert.c
@@ -110,15 +110,25 @@ METHOD(certificate_t, has_issuer, id_match_t,
METHOD(certificate_t, equals, bool,
private_pubkey_cert_t *this, certificate_t *other)
{
+ identification_t *other_subject;
public_key_t *other_key;
+ if (this == (private_pubkey_cert_t*)other)
+ {
+ return TRUE;
+ }
+ if (other->get_type(other) != CERT_TRUSTED_PUBKEY)
+ {
+ return FALSE;
+ }
other_key = other->get_public_key(other);
if (other_key)
{
if (public_key_equals(this->key, other_key))
{
other_key->destroy(other_key);
- return TRUE;
+ other_subject = other->get_subject(other);
+ return other_subject->equals(other_subject, this->subject);
}
other_key->destroy(other_key);
}