|
@@ -69,6 +69,12 @@ struct asn1_cursor private_key = {
|
69
|
69
|
.len = ( ( size_t ) private_key_len ),
|
70
|
70
|
};
|
71
|
71
|
|
|
72
|
+/** Default private key */
|
|
73
|
+static struct asn1_cursor default_private_key = {
|
|
74
|
+ .data = private_key_data,
|
|
75
|
+ .len = ( ( size_t ) private_key_len ),
|
|
76
|
+};
|
|
77
|
+
|
72
|
78
|
/** Private key setting */
|
73
|
79
|
static struct setting privkey_setting __setting ( SETTING_CRYPTO, privkey ) = {
|
74
|
80
|
.name = "privkey",
|
|
@@ -92,8 +98,8 @@ static int privkey_apply_settings ( void ) {
|
92
|
98
|
if ( ALLOW_KEY_OVERRIDE ) {
|
93
|
99
|
|
94
|
100
|
/* Restore default private key */
|
95
|
|
- private_key.data = private_key_data;
|
96
|
|
- private_key.len = ( ( size_t ) private_key_len );
|
|
101
|
+ memcpy ( &private_key, &default_private_key,
|
|
102
|
+ sizeof ( private_key ) );
|
97
|
103
|
|
98
|
104
|
/* Fetch new private key, if any */
|
99
|
105
|
free ( key_data );
|