]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Move lib/x509/pkcs12.h stuff to x509_int.h.
authorSimon Josefsson <simon@josefsson.org>
Tue, 26 Feb 2008 11:29:03 +0000 (12:29 +0100)
committerSimon Josefsson <simon@josefsson.org>
Tue, 26 Feb 2008 11:29:03 +0000 (12:29 +0100)
lib/x509/Makefile.am
lib/x509/pkcs12.c
lib/x509/pkcs12.h [deleted file]
lib/x509/pkcs12_bag.c
lib/x509/privkey_pkcs8.c
lib/x509/x509_int.h

index 28fbee5748d7253fceb800612cb65520605d4b15..7f0640b58c60291968f9a9f458aac31f336bb2f0 100644 (file)
@@ -32,7 +32,7 @@ libgnutls_x509_la_SOURCES = crl.c dn.c common.c x509.c extensions.c   \
        dsa.c rfc2818_hostname.c verify.c mpi.c privkey.c pkcs7.c       \
        crq.c sign.c privkey_pkcs8.c pkcs12.c pkcs12_bag.c              \
        pkcs12_encr.c x509_write.c crl_write.c common.h x509_int.h      \
-       pkcs12.h output.c
+       output.c
 
 EXTRA_DIST = x509-api.texi
 
index 4601b285b2c47f0c0c97eb0311bc1e059917c889..64f4881ca707e9b3cc0141c7dfd6e13bd2fa9e43 100644 (file)
@@ -37,7 +37,6 @@
 #include <common.h>
 #include <x509_b64.h>
 #include "x509_int.h"
-#include <pkcs12.h>
 #include <gc.h>
 
 
diff --git a/lib/x509/pkcs12.h b/lib/x509/pkcs12.h
deleted file mode 100644 (file)
index 64c3563..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (C) 2003, 2004, 2005 Free Software Foundation
- *
- * Author: Nikos Mavrogiannopoulos
- *
- * This file is part of GNUTLS.
- *
- * The GNUTLS library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- * USA
- *
- */
-
-typedef struct gnutls_pkcs12_int
-{
-  ASN1_TYPE pkcs12;
-} gnutls_pkcs12_int;
-
-typedef enum gnutls_pkcs12_bag_type_t
-{
-  GNUTLS_BAG_EMPTY = 0,
-
-  GNUTLS_BAG_PKCS8_ENCRYPTED_KEY = 1,
-  GNUTLS_BAG_PKCS8_KEY,
-  GNUTLS_BAG_CERTIFICATE,
-  GNUTLS_BAG_CRL,
-  GNUTLS_BAG_ENCRYPTED = 10,
-  GNUTLS_BAG_UNKNOWN = 20
-} gnutls_pkcs12_bag_type_t;
-
-#define MAX_BAG_ELEMENTS 32
-
-struct bag_element
-{
-  gnutls_datum_t data;
-  gnutls_pkcs12_bag_type_t type;
-  gnutls_datum_t local_key_id;
-  char *friendly_name;
-};
-
-typedef struct gnutls_pkcs12_bag_int
-{
-  struct bag_element element[MAX_BAG_ELEMENTS];
-  int bag_elements;
-} gnutls_pkcs12_bag_int;
-
-#define BAG_PKCS8_KEY "1.2.840.113549.1.12.10.1.1"
-#define BAG_PKCS8_ENCRYPTED_KEY "1.2.840.113549.1.12.10.1.2"
-#define BAG_CERTIFICATE "1.2.840.113549.1.12.10.1.3"
-#define BAG_CRL "1.2.840.113549.1.12.10.1.4"
-
-/* PKCS #7
- */
-#define DATA_OID "1.2.840.113549.1.7.1"
-#define ENC_DATA_OID "1.2.840.113549.1.7.6"
-
-/* Bag attributes
- */
-#define FRIENDLY_NAME_OID "1.2.840.113549.1.9.20"
-#define KEY_ID_OID "1.2.840.113549.1.9.21"
-
-typedef struct gnutls_pkcs12_int *gnutls_pkcs12_t;
-typedef struct gnutls_pkcs12_bag_int *gnutls_pkcs12_bag_t;
-
-int gnutls_pkcs12_init (gnutls_pkcs12_t * pkcs12);
-void gnutls_pkcs12_deinit (gnutls_pkcs12_t pkcs12);
-int gnutls_pkcs12_import (gnutls_pkcs12_t pkcs12,
-                         const gnutls_datum_t * data,
-                         gnutls_x509_crt_fmt_t format, unsigned int flags);
-
-int gnutls_pkcs12_get_bag (gnutls_pkcs12_t pkcs12,
-                          int indx, gnutls_pkcs12_bag_t bag);
-
-int gnutls_pkcs12_bag_init (gnutls_pkcs12_bag_t * bag);
-void gnutls_pkcs12_bag_deinit (gnutls_pkcs12_bag_t bag);
-
-int
-_pkcs12_string_to_key (unsigned int id, const opaque * salt,
-                      unsigned int salt_size, unsigned int iter,
-                      const char *pw, unsigned int req_keylen,
-                      opaque * keybuf);
-
-int _gnutls_pkcs7_decrypt_data (const gnutls_datum_t * data,
-                               const char *password, gnutls_datum_t * dec);
-
-typedef enum schema_id
-{
-  PBES2,                       /* the stuff in PKCS #5 */
-  PKCS12_3DES_SHA1,            /* the fucking stuff in PKCS #12 */
-  PKCS12_ARCFOUR_SHA1,
-  PKCS12_RC2_40_SHA1
-} schema_id;
-
-int _gnutls_pkcs7_encrypt_data (schema_id schema,
-                               const gnutls_datum_t * data,
-                               const char *password, gnutls_datum_t * enc);
-int _pkcs12_decode_safe_contents (const gnutls_datum_t * content,
-                                 gnutls_pkcs12_bag_t bag);
-
-int
-_pkcs12_encode_safe_contents (gnutls_pkcs12_bag_t bag, ASN1_TYPE * content,
-                             int *enc);
-
-int _pkcs12_decode_crt_bag (gnutls_pkcs12_bag_type_t type,
-                           const gnutls_datum_t * in, gnutls_datum_t * out);
-int _pkcs12_encode_crt_bag (gnutls_pkcs12_bag_type_t type,
-                           const gnutls_datum_t * raw, gnutls_datum_t * out);
index d701abe25b5536e4b2adabeddc3af2ec964916a9..0c613f1f56a717bf1e345761ffe6793a855030b4 100644 (file)
@@ -33,7 +33,7 @@
 #include <gnutls_global.h>
 #include <gnutls_errors.h>
 #include <common.h>
-#include <pkcs12.h>
+#include "x509_int.h"
 
 /**
   * gnutls_pkcs12_bag_init - This function initializes a gnutls_pkcs12_bag_t  structure
index 04946bac8fabe00ae2548288caf6095fbbbd1217..4ca8f0ea5849c708d5ffc8fc6813e97394f34c49 100644 (file)
@@ -34,7 +34,6 @@
 #include <gnutls_x509.h>
 #include <x509_b64.h>
 #include "x509_int.h"
-#include <pkcs12.h>
 #include <gnutls_algorithms.h>
 #include <gnutls_num.h>
 #include <gc.h>
index 550ec12b9ca28bff8f7d3d9fa41079fd861482a7..59d57557c147ace6575531b7a9aa39adad481349 100644 (file)
@@ -254,5 +254,100 @@ int _gnutls_x509_write_sig_params (ASN1_TYPE dst, const char *dst_name,
                                   gnutls_pk_algorithm_t pk_algorithm,
                                   gnutls_digest_algorithm_t, mpi_t * params,
                                   int params_size);
+/* pkcs12.h */
+typedef struct gnutls_pkcs12_int
+{
+  ASN1_TYPE pkcs12;
+} gnutls_pkcs12_int;
+
+typedef enum gnutls_pkcs12_bag_type_t
+  {
+    GNUTLS_BAG_EMPTY = 0,
+
+    GNUTLS_BAG_PKCS8_ENCRYPTED_KEY = 1,
+    GNUTLS_BAG_PKCS8_KEY,
+    GNUTLS_BAG_CERTIFICATE,
+    GNUTLS_BAG_CRL,
+    GNUTLS_BAG_ENCRYPTED = 10,
+    GNUTLS_BAG_UNKNOWN = 20
+  } gnutls_pkcs12_bag_type_t;
+
+#define MAX_BAG_ELEMENTS 32
+
+struct bag_element
+{
+  gnutls_datum_t data;
+  gnutls_pkcs12_bag_type_t type;
+  gnutls_datum_t local_key_id;
+  char *friendly_name;
+};
+
+typedef struct gnutls_pkcs12_bag_int
+{
+  struct bag_element element[MAX_BAG_ELEMENTS];
+  int bag_elements;
+} gnutls_pkcs12_bag_int;
+
+#define BAG_PKCS8_KEY "1.2.840.113549.1.12.10.1.1"
+#define BAG_PKCS8_ENCRYPTED_KEY "1.2.840.113549.1.12.10.1.2"
+#define BAG_CERTIFICATE "1.2.840.113549.1.12.10.1.3"
+#define BAG_CRL "1.2.840.113549.1.12.10.1.4"
+
+/* PKCS #7
+ */
+#define DATA_OID "1.2.840.113549.1.7.1"
+#define ENC_DATA_OID "1.2.840.113549.1.7.6"
+
+/* Bag attributes
+ */
+#define FRIENDLY_NAME_OID "1.2.840.113549.1.9.20"
+#define KEY_ID_OID "1.2.840.113549.1.9.21"
+
+typedef struct gnutls_pkcs12_int *gnutls_pkcs12_t;
+typedef struct gnutls_pkcs12_bag_int *gnutls_pkcs12_bag_t;
+
+int gnutls_pkcs12_init (gnutls_pkcs12_t * pkcs12);
+void gnutls_pkcs12_deinit (gnutls_pkcs12_t pkcs12);
+int gnutls_pkcs12_import (gnutls_pkcs12_t pkcs12,
+                         const gnutls_datum_t * data,
+                         gnutls_x509_crt_fmt_t format, unsigned int flags);
+
+int gnutls_pkcs12_get_bag (gnutls_pkcs12_t pkcs12,
+                          int indx, gnutls_pkcs12_bag_t bag);
+
+int gnutls_pkcs12_bag_init (gnutls_pkcs12_bag_t * bag);
+void gnutls_pkcs12_bag_deinit (gnutls_pkcs12_bag_t bag);
+
+int
+_pkcs12_string_to_key (unsigned int id, const opaque * salt,
+                      unsigned int salt_size, unsigned int iter,
+                      const char *pw, unsigned int req_keylen,
+                      opaque * keybuf);
+
+int _gnutls_pkcs7_decrypt_data (const gnutls_datum_t * data,
+                               const char *password, gnutls_datum_t * dec);
+
+typedef enum schema_id
+  {
+    PBES2,                     /* the stuff in PKCS #5 */
+    PKCS12_3DES_SHA1,          /* the fucking stuff in PKCS #12 */
+    PKCS12_ARCFOUR_SHA1,
+    PKCS12_RC2_40_SHA1
+  } schema_id;
+
+int _gnutls_pkcs7_encrypt_data (schema_id schema,
+                               const gnutls_datum_t * data,
+                               const char *password, gnutls_datum_t * enc);
+int _pkcs12_decode_safe_contents (const gnutls_datum_t * content,
+                                 gnutls_pkcs12_bag_t bag);
+
+int
+_pkcs12_encode_safe_contents (gnutls_pkcs12_bag_t bag, ASN1_TYPE * content,
+                             int *enc);
+
+int _pkcs12_decode_crt_bag (gnutls_pkcs12_bag_type_t type,
+                           const gnutls_datum_t * in, gnutls_datum_t * out);
+int _pkcs12_encode_crt_bag (gnutls_pkcs12_bag_type_t type,
+                           const gnutls_datum_t * raw, gnutls_datum_t * out);
 
 #endif