From: Simon Josefsson Date: Thu, 28 Aug 2008 09:32:06 +0000 (+0200) Subject: Make disable-extra-pki work better. X-Git-Tag: gnutls_2_5_5~41 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f0f2e1535ff596d44aa1e8b81eb30480031cd348;p=thirdparty%2Fgnutls.git Make disable-extra-pki work better. --- diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am index df1e89158f..df39364b03 100644 --- a/doc/examples/Makefile.am +++ b/doc/examples/Makefile.am @@ -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 diff --git a/lib/gnutls_x509.c b/lib/gnutls_x509.c index 066e3e1479..651ba61aa1 100644 --- a/lib/gnutls_x509.c +++ b/lib/gnutls_x509.c @@ -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) { diff --git a/lib/x509/output.c b/lib/x509/output.c index ee1a411eee..4789469861 100644 --- a/lib/x509/output.c +++ b/lib/x509/output.c @@ -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 */