Skip to contentSkip to conversation

Fix PolarSSL and --pkcs12 option issues

PATCH Superseded David Sommerseth 3 participants 3 messages Oct 23, 2011 – Oct 24, 2011

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix PolarSSL and --pkcs12 option issues

PolarSSL does not support PKCS#12 certificate/key bundles, but had a typo where #ifdef USE_POLARSSL was used, and it should have been #ifndef instead.

Also added a few extra exclusions of PKCS#12 messages where appropriate, to avoid confusing users.

---
 options.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
options.c +7 -1
index 39e7a57..4fd6933 100644
@@ -559,7 +559,9 @@ static const char usage_message[] =
   "                  by a Certificate Authority in --ca file.\n"
   "--extra-certs file : one or more PEM certs that complete the cert chain.\n"
   "--key file      : Local private key in .pem format.\n"
+#ifndef USE_POLARSSL
   "--pkcs12 file   : PKCS#12 file containing local private key, local certificate\n"
+#endif
   "                  and optionally the root CA certificate.\n"
 #ifdef ENABLE_X509ALTUSERNAME
   "--x509-username-field : Field used in x509 certificate to be username.\n"
@@ -1575,7 +1577,9 @@ show_settings (const struct options *o)
   SHOW_STR (dh_file);
   SHOW_STR (cert_file);
   SHOW_STR (priv_key_file);
+#ifndef USE_POLARSSL
   SHOW_STR (pkcs12_file);
+#endif
 #ifdef ENABLE_CRYPTOAPI
   SHOW_STR (cryptoapi_cert);
 #endif
@@ -2341,7 +2345,9 @@ options_postprocess_verify_ce (const struct options *options, const struct conne
       MUST_BE_UNDEF (dh_file);
       MUST_BE_UNDEF (cert_file);
       MUST_BE_UNDEF (priv_key_file);
+#ifndef USE_POLARSSL
       MUST_BE_UNDEF (pkcs12_file);
+#endif
       MUST_BE_UNDEF (cipher_list);
       MUST_BE_UNDEF (tls_verify);
       MUST_BE_UNDEF (tls_export_cert);
@@ -6262,7 +6268,7 @@ add_option (struct options *options,
 	}
 #endif
     }
-#ifdef USE_POLARSSL
+#ifndef USE_POLARSSL
   else if (streq (p[0], "pkcs12") && p[1])
     {
       VERIFY_PERMISSION (OPT_P_GENERAL);
Signature · 1 line
1.7.4.4
#1 lore raw

options.c static const char usage_message[] = · line 565

Quoted 12 lines · David Sommerseth
options.c +2 -0
index 39e7a57..4fd6933 100644
@@ -559,7 +559,9 @@ static const char usage_message[] =
   "                  by a Certificate Authority in --ca file.\n"
   "--extra-certs file : one or more PEM certs that complete the cert chain.\n"
   "--key file      : Local private key in .pem format.\n"
+#ifndef USE_POLARSSL
   "--pkcs12 file   : PKCS#12 file containing local private key, local certificate\n"
+#endif
   "                  and optionally the root CA certificate.\n"

Shouldn't that "#endif" be one line farther down, so that the "and optionally the root CA certificate.\n" line is excluded along with the preceding line?

Nathan
----------------------------------------------------------------------------
Nathan Stratton Treadway - [email protected]... - Mid-Atlantic region
Ray Ontko & Co. - Software consulting services - http://www.ontko.com/
GPG Key: http://www.ontko.com/~nathanst/gpg_key.txt ID: 1023D/ECFB6239
Key fingerprint = 6AD8 485E 20B9 5C71 231C 0C32 15F3 ADCD ECFB 6239

#2 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 14 lines · Nathan Stratton Treadway
Quoted 8 lines · David Sommerseth
options.c index 39e7a57..4fd6933 100644 --- renamed from options.c +0 -0

a/options.c +++ b/options.c @@ -559,7 +559,9 @@ static const char
usage_message[] = " by a Certificate Authority in
--ca file.\n" "--extra-certs file : one or more PEM certs that
complete the cert chain.\n" "--key file : Local private key in
.pem format.\n" +#ifndef USE_POLARSSL "--pkcs12 file : PKCS#12
file containing local private key, local certificate\n" +#endif " and optionally the root CA certificate.\n"

Shouldn't that "#endif" be one line farther down, so that the "and optionally the root CA certificate.\n" line is excluded along with the preceding line?

Duh! Thanks a lot! I've submitted a v2 patch of this patch, which fixes this as well.

kind regards,

David Sommerseth

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6lC7oACgkQDC186MBRfrovQQCgpzGkFut1J0+0fh0NjD2sPh5z HasAn3wHXRfHAVVLcHLdydpe4OmTuQxQ
=VE2C
-----END PGP SIGNATURE-----