diff options
author | Jonathan Beck | 2008-08-04 22:31:43 +0200 |
---|---|---|
committer | Matt Colyer | 2008-08-05 23:28:10 -0700 |
commit | 4b558a53f61005b0ca49665d2da92303f6e14872 (patch) | |
tree | 3631ebdcfbf681a239bde3192172d3014b56322b /src/initconf.c | |
parent | 20a6f8797add1a44aa6ea2cc1d089122d1f39be3 (diff) | |
download | libplist-4b558a53f61005b0ca49665d2da92303f6e14872.tar.gz libplist-4b558a53f61005b0ca49665d2da92303f6e14872.tar.bz2 |
Store certificates and private keys as PEM files instead of storing them in config file. Added functions to generate proper pairing request.
Signed-off-by: Matt Colyer <matt@colyer.name>
Diffstat (limited to 'src/initconf.c')
-rw-r--r-- | src/initconf.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/initconf.c b/src/initconf.c index 7d6aa28..960fb6b 100644 --- a/src/initconf.c +++ b/src/initconf.c @@ -93,25 +93,15 @@ int main(int argc, char *argv[]) { gnutls_x509_crt_export (root_cert, GNUTLS_X509_FMT_PEM, root_cert_pem.data, &root_cert_pem.size); gnutls_x509_crt_export (host_cert, GNUTLS_X509_FMT_PEM, host_cert_pem.data, &host_cert_pem.size); - /* encode in base64 for storage */ - char* root_key_b64 = g_base64_encode (root_key_pem.data,root_key_pem.size); - char* host_key_b64 = g_base64_encode (host_key_pem.data,host_key_pem.size); - - char* root_cert_b64 = g_base64_encode (root_cert_pem.data,root_cert_pem.size); - char* host_cert_b64 = g_base64_encode (host_cert_pem.data,host_cert_pem.size); /* store values in config file */ - init_config_file(host_id, root_key_b64, host_key_b64, root_cert_b64, host_cert_b64); + init_config_file(host_id, &root_key_pem, &host_key_pem, &root_cert_pem, &host_cert_pem); gnutls_free(root_key_pem.data); gnutls_free(host_key_pem.data); gnutls_free(root_cert_pem.data); gnutls_free(host_cert_pem.data); - g_free(root_key_b64); - g_free(host_key_b64); - g_free(root_cert_b64); - g_free(host_cert_b64); return 0; } |