|
@@ -93,13 +93,14 @@ struct x509_root root_certificates = {
|
93
|
93
|
* a rebuild.
|
94
|
94
|
*/
|
95
|
95
|
static void rootcert_init ( void ) {
|
|
96
|
+ static int initialised;
|
96
|
97
|
void *external = NULL;
|
97
|
98
|
int len;
|
98
|
99
|
|
99
|
100
|
/* Allow trusted root certificates to be overridden only if
|
100
|
101
|
* not explicitly specified at build time.
|
101
|
102
|
*/
|
102
|
|
- if ( ALLOW_TRUST_OVERRIDE ) {
|
|
103
|
+ if ( ALLOW_TRUST_OVERRIDE && ( ! initialised ) ) {
|
103
|
104
|
|
104
|
105
|
/* Fetch copy of "trust" setting, if it exists. This
|
105
|
106
|
* memory will never be freed.
|
|
@@ -109,6 +110,9 @@ static void rootcert_init ( void ) {
|
109
|
110
|
root_certificates.fingerprints = external;
|
110
|
111
|
root_certificates.count = ( len / FINGERPRINT_LEN );
|
111
|
112
|
}
|
|
113
|
+
|
|
114
|
+ /* Prevent subsequent modifications */
|
|
115
|
+ initialised = 1;
|
112
|
116
|
}
|
113
|
117
|
|
114
|
118
|
DBGC ( &root_certificates, "ROOTCERT using %d %s certificate(s):\n",
|
|
@@ -118,6 +122,6 @@ static void rootcert_init ( void ) {
|
118
|
122
|
}
|
119
|
123
|
|
120
|
124
|
/** Root certificate initialiser */
|
121
|
|
-struct init_fn rootcert_init_fn __init_fn ( INIT_LATE ) = {
|
122
|
|
- .initialise = rootcert_init,
|
|
125
|
+struct startup_fn rootcert_startup_fn __startup_fn ( STARTUP_LATE ) = {
|
|
126
|
+ .startup = rootcert_init,
|
123
|
127
|
};
|