diff cinst/windowsstore.c @ 1288:265583011f24

(issue123) Add possibility to open native certificate dialog This is currently only implemented for windows.
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 29 Sep 2014 13:12:58 +0200
parents 698b6a9bd75e
children 32a44cfb78c0
line wrap: on
line diff
--- a/cinst/windowsstore.c	Mon Sep 29 13:02:41 2014 +0200
+++ b/cinst/windowsstore.c	Mon Sep 29 13:12:58 2014 +0200
@@ -15,43 +15,7 @@
 #include "strhelp.h"
 #include "logging.h"
 #include "util.h"
-
-static PCCERT_CONTEXT
-b64_to_cert_context(char *b64_data, size_t b64_size)
-{
-  size_t buf_size = 0;
-  char *buf = NULL;
-  PCCERT_CONTEXT pCert = NULL;
-  int ret = -1;
-
-  ret = str_base64_decode (&buf, &buf_size, b64_data, b64_size);
-
-  if (ret != 0)
-    {
-      ERRORPRINTF ("decoding certificate failed\n");
-      return NULL;
-    }
-
-  pCert = CertCreateContext (CERT_STORE_CERTIFICATE_CONTEXT,
-                             X509_ASN_ENCODING | PKCS_7_ASN_ENCODING,
-                             (const PBYTE) buf,
-                             (DWORD) buf_size,
-                             0,
-                             NULL);
-  free (buf); /* Windows has a copy */
-
-  if (pCert == NULL)
-    {
-      char *error = getLastErrorMsg();
-      if (error)
-        {
-          ERRORPRINTF ("Failed to create cert context: %s \n", error);
-          free (error);
-        }
-      return NULL;
-    }
-  return pCert;
-}
+#include "certhelp.h"
 
 void
 do_remove(HCERTSTORE hStore, char **to_remove)

http://wald.intevation.org/projects/trustbridge/