Skip to content

Commit cd3b9cd

Browse files
authored
Adding no-op X509_TRUST_cleanup for select application compatibility (aws#2257)
### Description of changes: - Re-implements X509_TRUST_cleanup() as a No-Op function after previous removal - Function was removed in commit #74c1f2a but is needed for select consuming applications - Added documentation explaining AWS-LC's different approach to trust settings ### Testing: - No regression testing needed (No-Op implementation) By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.
1 parent 5054cf0 commit cd3b9cd

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

crypto/x509/x509_trs.c

+10
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,16 @@ char *X509_TRUST_get0_name(const X509_TRUST *xp) { return xp->name; }
139139

140140
int X509_TRUST_get_trust(const X509_TRUST *xp) { return xp->trust; }
141141

142+
void X509_TRUST_cleanup(void) {
143+
// This is an intentional No-Op (no operation) function.
144+
//
145+
// Historical Context:
146+
// - This function existed in OpenSSL versions prior to 1.1.0
147+
// - AWS-LC does not support static trust settings storage
148+
//
149+
// - Kept for API compatibility with older versions
150+
}
151+
142152
static int trust_1oidany(const X509_TRUST *trust, X509 *x) {
143153
if (x->aux && (x->aux->trust || x->aux->reject)) {
144154
return obj_trust(trust->arg1, x);

include/openssl/x509.h

+5
Original file line numberDiff line numberDiff line change
@@ -5090,6 +5090,11 @@ OPENSSL_EXPORT int X509_TRUST_get_by_id(int id);
50905090
OPENSSL_EXPORT int X509_TRUST_get_flags(const X509_TRUST *xp);
50915091
OPENSSL_EXPORT char *X509_TRUST_get0_name(const X509_TRUST *xp);
50925092
OPENSSL_EXPORT int X509_TRUST_get_trust(const X509_TRUST *xp);
5093+
// X509_TRUST_cleanup intentionally does nothing.
5094+
// This function is maintained only for compatibility with applications
5095+
// that consume OpenSSL APIs. AWS-LC does not support the related
5096+
// static trust settings functions which were also deprecated in OpenSSL 1.1.0.
5097+
OPENSSL_EXPORT OPENSSL_DEPRECATED void X509_TRUST_cleanup(void);
50935098

50945099
#define X509_LU_NONE 0
50955100
#define X509_LU_X509 1

0 commit comments

Comments
 (0)