]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
pubkey: Remove unused set_subject() method
authorTobias Brunner <tobias@strongswan.org>
Fri, 6 Dec 2024 10:52:37 +0000 (11:52 +0100)
committerTobias Brunner <tobias@strongswan.org>
Tue, 10 Dec 2024 08:09:29 +0000 (09:09 +0100)
If not properly used (i.e. before sharing the object), this was not
thread-safe.  So better remove it and force users to create immutable
objects.

src/libstrongswan/plugins/pubkey/pubkey_cert.c
src/libstrongswan/plugins/pubkey/pubkey_cert.h

index ca35d120580efb6b9a8f7662cd88fd0541eed305..e8590dd65a9fa152ab6f06caf45f179a26221ba4 100644 (file)
@@ -201,13 +201,6 @@ METHOD(certificate_t, destroy, void,
        }
 }
 
-METHOD(pubkey_cert_t, set_subject, void,
-       private_pubkey_cert_t *this, identification_t *subject)
-{
-       DESTROY_IF(this->subject);
-       this->subject = subject->clone(subject);
-}
-
 /*
  * see header file
  */
@@ -234,7 +227,6 @@ static pubkey_cert_t *pubkey_cert_create(public_key_t *key,
                                .get_ref = _get_ref,
                                .destroy = _destroy,
                        },
-                       .set_subject = _set_subject,
                },
                .ref = 1,
                .key = key,
index ab34120446f8243543328e3e155982c5ef386537..d0503ae30c388d87c5cc0aacd5001f1ccf3083f9 100644 (file)
@@ -36,13 +36,6 @@ struct pubkey_cert_t {
         * Implements certificate_t.
         */
        certificate_t interface;
-
-       /**
-        * Set the subject of the trusted public key.
-        *
-        * @param subject       subject to be set
-        */
-       void (*set_subject)(pubkey_cert_t *this, identification_t *subject);
 };
 
 /**