summaryrefslogtreecommitdiffstats
path: root/src/crypto
diff options
context:
space:
mode:
authorMichael Brown2013-12-03 17:48:56 +0100
committerMichael Brown2013-12-05 01:37:02 +0100
commit22001cb206c1320aee27f679a63d2171d35e99c5 (patch)
treea972bb914371a68d4925dcc007238dcb836546ba /src/crypto
parent[fbcon] Add support for displaying a cursor (diff)
downloadipxe-22001cb206c1320aee27f679a63d2171d35e99c5.tar.gz
ipxe-22001cb206c1320aee27f679a63d2171d35e99c5.tar.xz
ipxe-22001cb206c1320aee27f679a63d2171d35e99c5.zip
[settings] Explicitly separate the concept of a completed fetched setting
The fetch_setting() family of functions may currently modify the definition of the specified setting (e.g. to add missing type information). Clean up this interface by requiring callers to provide an explicit buffer to contain the completed definition of the fetched setting, if required. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/crypto')
-rw-r--r--src/crypto/clientcert.c8
-rw-r--r--src/crypto/rootcert.c4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/crypto/clientcert.c b/src/crypto/clientcert.c
index 6f6bf113..b09c880a 100644
--- a/src/crypto/clientcert.c
+++ b/src/crypto/clientcert.c
@@ -128,8 +128,8 @@ static int clientcert_apply_settings ( void ) {
/* Fetch new client certificate, if any */
free ( cert );
- if ( ( len = fetch_setting_copy ( NULL, &cert_setting,
- &cert ) ) >= 0 ) {
+ if ( ( len = fetch_raw_setting_copy ( NULL, &cert_setting,
+ &cert ) ) >= 0 ) {
client_certificate.data = cert;
client_certificate.len = len;
}
@@ -140,8 +140,8 @@ static int clientcert_apply_settings ( void ) {
/* Fetch new client private key, if any */
free ( key );
- if ( ( len = fetch_setting_copy ( NULL, &privkey_setting,
- &key ) ) >= 0 ) {
+ if ( ( len = fetch_raw_setting_copy ( NULL, &privkey_setting,
+ &key ) ) >= 0 ) {
client_private_key.data = key;
client_private_key.len = len;
}
diff --git a/src/crypto/rootcert.c b/src/crypto/rootcert.c
index 2aa31334..cfeabb81 100644
--- a/src/crypto/rootcert.c
+++ b/src/crypto/rootcert.c
@@ -100,8 +100,8 @@ static void rootcert_init ( void ) {
/* Fetch copy of "trust" setting, if it exists. This
* memory will never be freed.
*/
- if ( ( len = fetch_setting_copy ( NULL, &trust_setting,
- &external ) ) >= 0 ) {
+ if ( ( len = fetch_raw_setting_copy ( NULL, &trust_setting,
+ &external ) ) >= 0 ) {
root_certificates.fingerprints = external;
root_certificates.count = ( len / FINGERPRINT_LEN );
}