summaryrefslogtreecommitdiffstats
path: root/src/initconf.c
diff options
context:
space:
mode:
authorGravatar Christophe Fergeau2008-08-10 23:36:33 +0200
committerGravatar Matt Colyer2008-08-11 09:39:06 -0700
commiteea922593e61a71d3f231578f1e8c4c7f035ec9c (patch)
tree823d5ae4e53be4b83377ab205b1aed94fe06c021 /src/initconf.c
parent323459826aeea8b88872e14af9839a0912a80503 (diff)
downloadlibplist-eea922593e61a71d3f231578f1e8c4c7f035ec9c.tar.gz
libplist-eea922593e61a71d3f231578f1e8c4c7f035ec9c.tar.bz2
Fix compilation with gcc 4.3 -Wall -Werror -Wno-pointer-sign
Signed-off-by: Matt Colyer <matt@colyer.name>
Diffstat (limited to 'src/initconf.c')
-rw-r--r--src/initconf.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/initconf.c b/src/initconf.c
index be697e8..0149ac9 100644
--- a/src/initconf.c
+++ b/src/initconf.c
@@ -22,6 +22,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <gnutls/gnutls.h>
+#include <gnutls/x509.h>
#include <glib.h>
#include "userpref.h"
@@ -54,6 +55,7 @@ int main(int argc, char *argv[]) {
gnutls_global_init();
+ size_t size;
char* host_id = NULL; //"29942970-207913891623273984"
gnutls_x509_privkey_t root_privkey;
gnutls_x509_privkey_t host_privkey;
@@ -99,26 +101,34 @@ int main(int argc, char *argv[]) {
gnutls_datum_t root_key_pem = {NULL, 0};
gnutls_datum_t host_key_pem = {NULL, 0};
- gnutls_x509_privkey_export (root_privkey, GNUTLS_X509_FMT_PEM, NULL, &root_key_pem.size);
- gnutls_x509_privkey_export (host_privkey, GNUTLS_X509_FMT_PEM, NULL, &host_key_pem.size);
+ gnutls_x509_privkey_export (root_privkey, GNUTLS_X509_FMT_PEM, NULL, &size);
+ root_key_pem.size = size;
+ gnutls_x509_privkey_export (host_privkey, GNUTLS_X509_FMT_PEM, NULL, &size);
+ host_key_pem.size = size;
root_key_pem.data = gnutls_malloc(root_key_pem.size);
host_key_pem.data = gnutls_malloc(host_key_pem.size);
- gnutls_x509_privkey_export (root_privkey, GNUTLS_X509_FMT_PEM, root_key_pem.data, &root_key_pem.size);
- gnutls_x509_privkey_export (host_privkey, GNUTLS_X509_FMT_PEM, host_key_pem.data, &host_key_pem.size);
+ gnutls_x509_privkey_export (root_privkey, GNUTLS_X509_FMT_PEM, root_key_pem.data, &size);
+ root_key_pem.size = size;
+ gnutls_x509_privkey_export (host_privkey, GNUTLS_X509_FMT_PEM, host_key_pem.data, &size);
+ host_key_pem.size = size;
gnutls_datum_t root_cert_pem = {NULL, 0};
gnutls_datum_t host_cert_pem = {NULL, 0};
- gnutls_x509_crt_export (root_cert, GNUTLS_X509_FMT_PEM, NULL, &root_cert_pem.size);
- gnutls_x509_crt_export (host_cert, GNUTLS_X509_FMT_PEM, NULL, &host_cert_pem.size);
+ gnutls_x509_crt_export (root_cert, GNUTLS_X509_FMT_PEM, NULL, &size);
+ root_cert_pem.size = size;
+ gnutls_x509_crt_export (host_cert, GNUTLS_X509_FMT_PEM, NULL, &size);
+ host_cert_pem.size = size;
root_cert_pem.data = gnutls_malloc(root_cert_pem.size);
host_cert_pem.data = gnutls_malloc(host_cert_pem.size);
- 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);
+ gnutls_x509_crt_export (root_cert, GNUTLS_X509_FMT_PEM, root_cert_pem.data, &size);
+ root_cert_pem.size = size;
+ gnutls_x509_crt_export (host_cert, GNUTLS_X509_FMT_PEM, host_cert_pem.data, &size);
+ host_cert_pem.size = size;
/* store values in config file */