From: Tobias Brunner Date: Fri, 6 Dec 2024 10:52:37 +0000 (+0100) Subject: pubkey: Remove unused set_subject() method X-Git-Tag: android-2.5.3~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ddd1126e96fbdfddef08c6567dec712c0e2ab00e;p=thirdparty%2Fstrongswan.git pubkey: Remove unused set_subject() method 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. --- diff --git a/src/libstrongswan/plugins/pubkey/pubkey_cert.c b/src/libstrongswan/plugins/pubkey/pubkey_cert.c index ca35d12058..e8590dd65a 100644 --- a/src/libstrongswan/plugins/pubkey/pubkey_cert.c +++ b/src/libstrongswan/plugins/pubkey/pubkey_cert.c @@ -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, diff --git a/src/libstrongswan/plugins/pubkey/pubkey_cert.h b/src/libstrongswan/plugins/pubkey/pubkey_cert.h index ab34120446..d0503ae30c 100644 --- a/src/libstrongswan/plugins/pubkey/pubkey_cert.h +++ b/src/libstrongswan/plugins/pubkey/pubkey_cert.h @@ -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); }; /**