]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Make disable-extra-pki work better.
authorSimon Josefsson <simon@josefsson.org>
Thu, 28 Aug 2008 09:32:06 +0000 (11:32 +0200)
committerSimon Josefsson <simon@josefsson.org>
Thu, 28 Aug 2008 09:32:06 +0000 (11:32 +0200)
doc/examples/Makefile.am
lib/gnutls_x509.c
lib/x509/output.c

index df1e89158f63737610766f5e8f4bbef393e21d82..df39364b031eca09fdfcf7093ffec870f780dff2 100644 (file)
@@ -32,8 +32,11 @@ CXX_LDADD = $(LDADD) \
        ../../lib/libgnutlsxx.la
 
 noinst_PROGRAMS = ex-client2 ex-client-resume
-noinst_PROGRAMS += ex-cert-select ex-crq
-noinst_PROGRAMS += ex-serv1 ex-serv-export
+noinst_PROGRAMS += ex-cert-select
+
+if ENABLE_PKI
+noinst_PROGRAMS += ex-crq ex-serv1 ex-serv-export
+endif
 
 if ENABLE_CXX
 ex_cxx_SOURCES = ex-cxx.cpp
@@ -51,7 +54,10 @@ noinst_PROGRAMS += ex-serv-pgp
 endif
 
 if ENABLE_PSK
-noinst_PROGRAMS += ex-client-psk ex-serv-psk
+noinst_PROGRAMS += ex-client-psk
+if ENABLE_PKI
+noinst_PROGRAMS += ex-serv-psk
+endif
 endif
 
 if ENABLE_SRP
index 066e3e147997d2cc41278999653b7c91b606078d..651ba61aa1d7fefa999925a88527878c0cced734 100644 (file)
@@ -537,11 +537,12 @@ _gnutls_x509_raw_privkey_to_gkey (gnutls_privkey * privkey,
 
   ret = gnutls_x509_privkey_import (tmpkey, raw_key, type);
 
+#ifdef ENABLE_PKI
   /* If normal key decoding doesn't work try decoding a plain PKCS #8 key */
   if (ret < 0)
-    ret =
-      gnutls_x509_privkey_import_pkcs8 (tmpkey, raw_key, type, NULL,
-                                       GNUTLS_PKCS_PLAIN);
+    ret = gnutls_x509_privkey_import_pkcs8 (tmpkey, raw_key, type,
+                                           NULL, GNUTLS_PKCS_PLAIN);
+#endif
 
   if (ret < 0)
     {
index ee1a411eee11b1c58b232a0c6e3c56f3f7f1e02a..47894698610e9a4d8b146923b94dc646448fa1c7 100644 (file)
@@ -233,6 +233,8 @@ print_key_usage (gnutls_string * str, gnutls_x509_crt_t cert)
     addf (str, _("\t\t\tKey decipher only.\n"));
 }
 
+#ifdef ENABLE_PKI
+
 static void
 print_crldist (gnutls_string * str, gnutls_x509_crt_t cert)
 {
@@ -363,6 +365,8 @@ print_key_purpose (gnutls_string * str, gnutls_x509_crt_t cert)
     }
 }
 
+#endif
+
 static void
 print_basic (gnutls_string * str, gnutls_x509_crt_t cert)
 {
@@ -613,6 +617,7 @@ print_cert (gnutls_string * str, gnutls_x509_crt_t cert, int notsigned)
          name = _("unknown");
 
        addf (str, _("\tSubject Public Key Algorithm: %s\n"), name);
+#ifdef ENABLE_PKI
        switch (err)
          {
          case GNUTLS_PK_RSA:
@@ -661,6 +666,7 @@ print_cert (gnutls_string * str, gnutls_x509_crt_t cert, int notsigned)
          default:
            break;
          }
+#endif
       }
   }
 
@@ -770,7 +776,9 @@ print_cert (gnutls_string * str, gnutls_x509_crt_t cert, int notsigned)
              addf (str, _("\t\tKey Purpose (%s):\n"),
                    critical ? _("critical") : _("not critical"));
 
+#ifdef ENABLE_PKI
              print_key_purpose (str, cert);
+#endif
 
              keypurpose_idx++;
            }
@@ -800,7 +808,9 @@ print_cert (gnutls_string * str, gnutls_x509_crt_t cert, int notsigned)
              addf (str, _("\t\tCRL Distribution points (%s):\n"),
                    critical ? _("critical") : _("not critical"));
 
+#ifdef ENABLE_PKI
              print_crldist (str, cert);
+#endif
 
              crldist_idx++;
            }
@@ -1169,6 +1179,8 @@ gnutls_x509_crt_print (gnutls_x509_crt_t cert,
   return 0;
 }
 
+#ifdef ENABLE_PKI
+
 static void
 print_crl (gnutls_string * str, gnutls_x509_crl_t crl, int notsigned)
 {
@@ -1363,3 +1375,5 @@ gnutls_x509_crl_print (gnutls_x509_crl_t crl,
 
   return 0;
 }
+
+#endif /* ENABLE_PKI */