Skip to contentSkip to conversation

Fix a build-ca issue on Windows

PATCH In review [email protected]... 4 participants 18 messages Jun 17, 2011 – Jul 1, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix a build-ca issue on Windows

From: Samuli Seppänen <[email protected]...>

Fixes Trac ticket #125

---
 easy-rsa/Windows/init-config.bat |    1 -
 win/openvpn.nsi                  |    5 +++--
 2 files changed, 3 insertions(+), 3 deletions(-)
easy-rsa/Windows/init-config.bat +0 -1
index 048d558..12e6d78 100755
@@ -1,2 +1 @@
 copy vars.bat.sample vars.bat
-copy openssl.cnf.sample openssl.cnf
win/openvpn.nsi +3 -2
index d3f80d0..82be118 100755
@@ -272,8 +272,9 @@ Section "${PRODUCT_NAME} RSA Certificate Management Scripts" SecOpenVPNEasyRSA
 
   # FIXME: the easy-rsa directory would need cleaning up
 
-  # Original nsi script looked for openssl.cnf.sample
-  File "${EASYRSA}\2.0\openssl.cnf"
+  # Original nsi script looked for ${EASYRSA}\2.0\openssl.cnf.sample. A newer 
+  # openssl.cnf is needed on OpenVPN 2.2+.
+  File "${EASYRSA}\Windows\openssl.cnf"
 
   File "${EASYRSA}\Windows\vars.bat.sample"
 
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/1 Add new openssl.cnf to easy-rsa/Windows

From: Samuli Seppänen <[email protected]...>

This is required for patch "Fix a build-ca issue on Windows" to work

---
 easy-rsa/Windows/openssl.cnf |  350 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 350 insertions(+), 0 deletions(-)
 create mode 100644 easy-rsa/Windows/openssl.cnf
easy-rsa/Windows/openssl.cnf new file +350 -0
new file mode 100644
index 0000000..9d2cd5b
@@ -0,0 +1,350 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME			= .
+RANDFILE		= $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file		= $ENV::HOME/.oid
+oid_section		= new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions		= 
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca', 'req' and 'ts'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+# Policies used by the TSA examples.
+tsa_policy1 = 1.2.3.4.1
+tsa_policy2 = 1.2.3.4.5.6
+tsa_policy3 = 1.2.3.4.5.7
+
+####################################################################
+[ ca ]
+default_ca	= CA_default		# The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir		= ./demoCA		# Where everything is kept
+certs		= $dir/certs		# Where the issued certs are kept
+crl_dir		= $dir/crl		# Where the issued crl are kept
+database	= $dir/index.txt	# database index file.
+#unique_subject	= no			# Set to 'no' to allow creation of
+					# several ctificates with same subject.
+new_certs_dir	= $dir/newcerts		# default place for new certs.
+
+certificate	= $dir/cacert.pem 	# The CA certificate
+serial		= $dir/serial 		# The current serial number
+crlnumber	= $dir/crlnumber	# the current crl number
+					# must be commented out to leave a V1 CRL
+crl		= $dir/crl.pem 		# The current CRL
+private_key	= $dir/private/cakey.pem# The private key
+RANDFILE	= $dir/private/.rand	# private random number file
+
+x509_extensions	= usr_cert		# The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt 	= ca_default		# Subject Name options
+cert_opt 	= ca_default		# Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions	= crl_ext
+
+default_days	= 365			# how long to certify for
+default_crl_days= 30			# how long before next CRL
+default_md	= default		# use public key default MD
+preserve	= no			# keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy		= policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName		= match
+stateOrProvinceName	= match
+organizationName	= match
+organizationalUnitName	= optional
+commonName		= supplied
+emailAddress		= optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName		= optional
+stateOrProvinceName	= optional
+localityName		= optional
+organizationName	= optional
+organizationalUnitName	= optional
+commonName		= supplied
+emailAddress		= optional
+
+####################################################################
+[ req ]
+default_bits		= 1024
+default_keyfile 	= privkey.pem
+distinguished_name	= req_distinguished_name
+attributes		= req_attributes
+x509_extensions	= v3_ca	# The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options. 
+# default: PrintableString, T61String, BMPString.
+# pkix	 : PrintableString, BMPString (PKIX recommendation before 2004)
+# utf8only: only UTF8Strings (PKIX recommendation after 2004).
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: ancient versions of Netscape crash on BMPStrings or UTF8Strings.
+string_mask = utf8only
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName			= Country Name (2 letter code)
+countryName_default		= AU
+countryName_min			= 2
+countryName_max			= 2
+
+stateOrProvinceName		= State or Province Name (full name)
+stateOrProvinceName_default	= Some-State
+
+localityName			= Locality Name (eg, city)
+
+0.organizationName		= Organization Name (eg, company)
+0.organizationName_default	= Internet Widgits Pty Ltd
+
+# we can do this but it is not needed normally :-)
+#1.organizationName		= Second Organization Name (eg, company)
+#1.organizationName_default	= World Wide Web Pty Ltd
+
+organizationalUnitName		= Organizational Unit Name (eg, section)
+#organizationalUnitName_default	=
+
+commonName			= Common Name (eg, YOUR name)
+commonName_max			= 64
+
+emailAddress			= Email Address
+emailAddress_max		= 64
+
+# SET-ex3			= SET extension number 3
+
+[ req_attributes ]
+challengePassword		= A challenge password
+challengePassword_min		= 4
+challengePassword_max		= 20
+
+unstructuredName		= An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType			= server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment			= "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl		= http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This is required for TSA certificates.
+# extendedKeyUsage = critical,timeStamping
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer
+
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType			= server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment			= "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl		= http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
+
+####################################################################
+[ tsa ]
+
+default_tsa = tsa_config1	# the default TSA section
+
+[ tsa_config1 ]
+
+# These are used by the TSA reply generation only.
+dir		= ./demoCA		# TSA root directory
+serial		= $dir/tsaserial	# The current serial number (mandatory)
+crypto_device	= builtin		# OpenSSL engine to use for signing
+signer_cert	= $dir/tsacert.pem 	# The TSA signing certificate
+					# (optional)
+certs		= $dir/cacert.pem	# Certificate chain to include in reply
+					# (optional)
+signer_key	= $dir/private/tsakey.pem # The TSA private key (optional)
+
+default_policy	= tsa_policy1		# Policy if request did not specify it
+					# (optional)
+other_policies	= tsa_policy2, tsa_policy3	# acceptable policies (optional)
+digests		= md5, sha1		# Acceptable message digests (mandatory)
+accuracy	= secs:1, millisecs:500, microsecs:100	# (optional)
+clock_precision_digits  = 0	# number of digits after dot. (optional)
+ordering		= yes	# Is ordering defined for timestamps?
+				# (optional, default: no)
+tsa_name		= yes	# Must the TSA name be included in the reply?
+				# (optional, default: no)
+ess_cert_id_chain	= no	# Must the ESS cert id chain be included?
+				# (optional, default: no)
Signature · 1 line
1.7.4.1
Acked-by on v1 1/1
#2 lore raw

Re: [Openvpn-devel] [PATCH] Add new openssl.cnf to easy-rsa/Windows

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

Quoted 7 lines · On 20/06/11 09:49, [email protected]... wrote:

From: Samuli Seppänen <[email protected]...>

This is required for patch "Fix a build-ca issue on Windows" to work

---
 easy-rsa/Windows/openssl.cnf |  350 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 350 insertions(+), 0 deletions(-)
 create mode 100644 easy-rsa/Windows/openssl.cnf

ACK. Applied to master and release/2.2

I see that 'extendedKeyUsage=serverAuth' is not set. I am not 100% sure if that is needed or not, or just "nice to have". This was mentioned in Trac ticket #125 [1]. So I'm accepting the openssl.cnf patch as it is now, and we can rather fix this attribute later on if it is not enough.

commit 663860ad04dd4190fddbee63e724d3fdceafd937 (master) commit 6989cbde616a00380acf3a390959987765a5325b (release/2.2)

Author: Samuli Seppänen <[email protected]...>
Date:   Mon Jun 20 10:49:41 2011 +0300

Add new openssl.cnf to easy-rsa/Windows

This is required for patch "Fix a build-ca issue on Windows" to work

Kind regards,

David Sommerseth

[1] <https://community.openvpn.net/openvpn/ticket/125>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk3/EnsACgkQDC186MBRfroPsQCfT6am6MJsmzhaNtWEOWfs0PFp KyMAn1M3ljU1cf6BWgL/8rraB0IBrh4O
=VmQ8
-----END PGP SIGNATURE-----

#3 lore raw

Re: [Openvpn-devel] [PATCH] Add new openssl.cnf to easy-rsa/Windows

NACK on this patch - the openssl.cnf file should be (almost) the same as the one used in easy-rsa/2.0 that way the certificates are generated in the same manner (*with* EKU=ServerAuth)

JJK

Quoted 59 lines · David Sommerseth

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

Quoted 8 lines · On 20/06/11 09:49, [email protected]... wrote:

From: Samuli Seppänen <[email protected]...>

This is required for patch "Fix a build-ca issue on Windows" to work

---
 easy-rsa/Windows/openssl.cnf |  350 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 350 insertions(+), 0 deletions(-)
 create mode 100644 easy-rsa/Windows/openssl.cnf

ACK. Applied to master and release/2.2

I see that 'extendedKeyUsage=serverAuth' is not set. I am not 100% sure if that is needed or not, or just "nice to have". This was mentioned in Trac ticket #125 [1]. So I'm accepting the openssl.cnf patch as it is now, and we can rather fix this attribute later on if it is not enough.

commit 663860ad04dd4190fddbee63e724d3fdceafd937 (master) commit 6989cbde616a00380acf3a390959987765a5325b (release/2.2)

Author: Samuli Seppänen <[email protected]...>
Date:   Mon Jun 20 10:49:41 2011 +0300

Add new openssl.cnf to easy-rsa/Windows

This is required for patch "Fix a build-ca issue on Windows" to work

Kind regards,

David Sommerseth

[1] <https://community.openvpn.net/openvpn/ticket/125>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk3/EnsACgkQDC186MBRfroPsQCfT6am6MJsmzhaNtWEOWfs0PFp KyMAn1M3ljU1cf6BWgL/8rraB0IBrh4O
=VmQ8
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#4 lore raw

Re: [Openvpn-devel] [PATCH] Add new openssl.cnf to easy-rsa/Windows

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

Quoted 5 lines · Jan Just Keijser

NACK on this patch - the openssl.cnf file should be (almost) the same as the one used in easy-rsa/2.0
that way the certificates are generated in the same manner (*with* EKU=ServerAuth)

Okay, I'll revert commit 663860ad04dd4190fddbee63e724d3fdceafd937 (master) and 6989cbde616a00380acf3a390959987765a5325b (release/2.2) immediately.

Samuli, can you please look closer into this? I did a more careful diff from 2.0/openssl.cnf and Windows/openssl.cnf ... and it seems quite different. Can we please unite them?

JJK: Do you know which differences are needed between Windows and non-Windows?

kind regards,

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

iEYEARECAAYFAk3/Fl0ACgkQDC186MBRfrpmVwCeMIIaJNAzihq7SSHJ3BQdxMoW /ioAoKbAENB4uekWYa0LCWmj1/ZM3TNm
=LrKg
-----END PGP SIGNATURE-----

#5 lore raw

Re: [Openvpn-devel] [PATCH] Add new openssl.cnf to easy-rsa/Windows

Hi David,

Quoted 12 lines · David Sommerseth

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

Quoted 6 lines · Jan Just Keijser

NACK on this patch - the openssl.cnf file should be (almost) the same as the one used in easy-rsa/2.0
that way the certificates are generated in the same manner (*with* EKU=ServerAuth)

Quoted 10 lines

Okay, I'll revert commit 663860ad04dd4190fddbee63e724d3fdceafd937 (master) and 6989cbde616a00380acf3a390959987765a5325b (release/2.2) immediately.

Samuli, can you please look closer into this? I did a more careful diff from 2.0/openssl.cnf and Windows/openssl.cnf ... and it seems quite different. Can we please unite them?

JJK: Do you know which differences are needed between Windows and non-Windows?

I just checked that the openssl.cnf file shipped with the windows version of openvpn 2.1.4 is identical to the easy-rsa/2.0 version - is there any reason not to do the same for openvpn 2.2?

cheers,

JJK

#6 lore raw

Re: [Openvpn-devel] [PATCH] Add new openssl.cnf to easy-rsa/Windows

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

On 20/06/11 12:30, Jan Just Keijser wrote:
[...snip...]

Quoted 4 lines
Quoted 4 lines

Samuli, can you please look closer into this? I did a more careful diff from 2.0/openssl.cnf and Windows/openssl.cnf ... and it seems quite different. Can we please unite them?

Quoted 8 lines
Quoted 4 lines

JJK: Do you know which differences are needed between Windows and non-Windows?

I just checked that the openssl.cnf file shipped with the windows version of openvpn 2.1.4 is identical to the easy-rsa/2.0 version - is there any reason not to do the same for openvpn 2.2?

Good question!

Samuli, what do you think? Could we actually just move the 2.0/openssl.cnf to a common directory where the installers will pick this config file? To have the same file in more places in the source tree sounds chaotic for me, especially when 2.1.4 uses the same file everywhere.

I'd suggest ./easy-rsa as a good common base.

I'm also wondering if we need to still carry easy-rsa/1.0 in the source tree. It looks rather dead ...

$ git log --follow --oneline ./easy-rsa/1.0/
3c7f2f5 version 2.1_beta1

Compared to this:

$ git log --follow --oneline ./easy-rsa/2.0/
6dc6019 pkitool lacks expected option "--help"
2d4e768 bash->bourne script cleanup
564a210 Updated copyright date to 2010.
9f4725e pkitool lacks expected option "--help"
d7fa38f Update copyright to 2009.
2534aa4 Fixed revoke-full to deal with issue arising from addition ...
dbec0a2 Modified pkitool to allow flexibility in separating the Com...
d56dec6 Change to pkitool/openssl.cnf so that calling scripts can s...
367ed08 Copyright notice changed to reflect change in name of Telet...
1c0cc4a Copyright change OpenVPN Solutions LLC -> Telethra, Inc.
eca8691 Updated copyright notice to 2008.
4d90d73 Updated version & changelog.
d4fb6d4 Set tool defaults in pkitool.
eba4632 Added note about alternative version of easy-rsa that suppo...
8d54351 Clean up configure on FreeBSD for recent autotool versions ...
acb567c A few more updates: -r 1015:1025 https://svn.openvpn.net/pr...
a8105c6 Merged PKCS#11 extensions to easy-rsa/2.0  (Alon Bar-Lev). ...
513baee Small fixes: * Fixed variable declaration in crypto.c that ...
411e89a Merged --remote-cert-ku, --remote-cert-eku, and --remote-ce...
8810c26 Moved easy-rsa 2.0 scripts to easy-rsa/2.0 to be compatible...
$ git log --follow --oneline ./easy-rsa/Windows/
54c739e Revert "Add new openssl.cnf to easy-rsa/Windows"
663860a Add new openssl.cnf to easy-rsa/Windows
3810843 Fix a build-ca issue on Windows
6b2883a Change all CRLF linefeeds to LF linefeeds
d0b4271 In Windows build, package a statically linked openssl.exe t...
4030142 The easy-rsa directory installed by the windows installer c...
6fbf66f This is the start of the BETA21 branch. It includes the --t...

kind regards,

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

iEYEARECAAYFAk3/N1YACgkQDC186MBRfrqnhACfRIzVbmXxPr07nnD71SQWkf1H AxAAn3JCMtBqWh4X7loLPntg6vkAKeRt
=wEAg
-----END PGP SIGNATURE-----

#7 lore raw

Re: [Openvpn-devel] [PATCH] Add new openssl.cnf to easy-rsa/Windows

Hi all,

I falsely assumed openssl.cnf was a default file from OpenSSL release packages, even though it was heavily modified for easy-rsa. The root cause of the issue seems to be that OpenSSL 1.0.0 does not like undefined variables in openssl.cnf. I fixed the Windows side today, and a preliminary patch is available here:

<http://build.openvpn.net/0001-Updated-easy-rsa-for-OpenSSL-1.0.0.patch>

This patch applies on top of "Fix a build-ca issue on Windows" in "master" and fixes Trac ticket #125. A few other things still need fixing :

- Lack of file called "easy-rsa/2.0/openssl.cnf" will probably break "domake-win" builds - or at least easy-rsa on installers generated with it.
- openssl-1.0.0.cnf has not yet been tested on *NIX
- changes to "easy-rsa/2.0/vars" script have not been tested

The added environment variables should not have negative side-effects. I'll test Windows installer generation tomorrow to make sure easy-rsa works out of the box on Windows. Help with *NIX+OpenSSL 1.0.0 and "domake-win" would be appreciated.

Samuli

Quoted 72 lines · Jan Just Keijser

[...snip...]

Quoted 1 line
Quoted 1 line

Samuli, can you please look closer into this? I did a more careful

diff

Quoted 8 lines
Quoted 7 lines

from 2.0/openssl.cnf and Windows/openssl.cnf ... and it seems quite different. Can we please unite them?

JJK: Do you know which differences are needed between Windows and non-Windows?

I just checked that the openssl.cnf file shipped with the windows

version

Quoted 1 line

of openvpn 2.1.4 is identical to the easy-rsa/2.0 version - is

there any

Quoted 1 line

reason not to do the same for openvpn 2.2?

Good question!

Samuli, what do you think? Could we actually just move the 2.0/openssl.cnf
to a common directory where the installers will pick this config file? To have the same file in more places in the source tree sounds chaotic for me,
especially when 2.1.4 uses the same file everywhere.

I'd suggest ./easy-rsa as a good common base.

I'm also wondering if we need to still carry easy-rsa/1.0 in the source tree. It looks rather dead ...

$ git log --follow --oneline ./easy-rsa/1.0/
3c7f2f5 version 2.1_beta1

Compared to this:

$ git log --follow --oneline ./easy-rsa/2.0/
6dc6019 pkitool lacks expected option "--help"
2d4e768 bash->bourne script cleanup
564a210 Updated copyright date to 2010.
9f4725e pkitool lacks expected option "--help"
d7fa38f Update copyright to 2009.
2534aa4 Fixed revoke-full to deal with issue arising from addition ...
dbec0a2 Modified pkitool to allow flexibility in separating the Com...
d56dec6 Change to pkitool/openssl.cnf so that calling scripts can s...
367ed08 Copyright notice changed to reflect change in name of Telet...
1c0cc4a Copyright change OpenVPN Solutions LLC -> Telethra, Inc.
eca8691 Updated copyright notice to 2008.
4d90d73 Updated version & changelog.
d4fb6d4 Set tool defaults in pkitool.
eba4632 Added note about alternative version of easy-rsa that suppo...
8d54351 Clean up configure on FreeBSD for recent autotool versions ...
acb567c A few more updates: -r 1015:1025 https://svn.openvpn.net/pr...
a8105c6 Merged PKCS#11 extensions to easy-rsa/2.0  (Alon Bar-Lev). ...
513baee Small fixes: * Fixed variable declaration in crypto.c that ...
411e89a Merged --remote-cert-ku, --remote-cert-eku, and --remote-ce...
8810c26 Moved easy-rsa 2.0 scripts to easy-rsa/2.0 to be compatible...
$ git log --follow --oneline ./easy-rsa/Windows/
54c739e Revert "Add new openssl.cnf to easy-rsa/Windows"
663860a Add new openssl.cnf to easy-rsa/Windows
3810843 Fix a build-ca issue on Windows
6b2883a Change all CRLF linefeeds to LF linefeeds
d0b4271 In Windows build, package a statically linked openssl.exe t...
4030142 The easy-rsa directory installed by the windows installer c...
6fbf66f This is the start of the BETA21 branch. It includes the --t...

kind regards,

David Sommerseth

#8 lore raw

Re: [Openvpn-devel] [PATCH] Add new openssl.cnf to easy-rsa/Windows

Hi,

A new Windows installer based on release/2.2 branch with my easy-rsa patches applied is now available here:

<http://build.openvpn.net/downloads/releases/openvpn-2.2.1-install-preview-1.exe>

Also, a standalone version of fixed easy-rsa directory is available here:

<http://build.openvpn.net/easy-rsa.zip>

It can be extracted to an existing OpenVPN 2.2* install directory - just move old easy-rsa directory out of the way first. If you can, please test that it works as excepted. Basic usage on WinXP seemed to work fine:

$ init-config
$ vars
$ clean-all
$ build-ca
$ build-key-server
$ build-key client1

If possible, please test "domake-win" builds and see if/how they break. This is probably the most important fix for 2.2.1 which we hope to get out on Friday. Use of easy-rsa is documented in the included README file and here:

<http://openvpn.net/index.php/open-source/documentation/howto.html#pki>

Samuli

Quoted 101 lines

Hi all,

I falsely assumed openssl.cnf was a default file from OpenSSL release packages, even though it was heavily modified for easy-rsa. The root cause of the issue seems to be that OpenSSL 1.0.0 does not like undefined variables in openssl.cnf. I fixed the Windows side today, and a preliminary patch is available here:

<http://build.openvpn.net/0001-Updated-easy-rsa-for-OpenSSL-1.0.0.patch>

This patch applies on top of "Fix a build-ca issue on Windows" in "master" and fixes Trac ticket #125. A few other things still need fixing :

- Lack of file called "easy-rsa/2.0/openssl.cnf" will probably break "domake-win" builds - or at least easy-rsa on installers generated with it.
- openssl-1.0.0.cnf has not yet been tested on *NIX
- changes to "easy-rsa/2.0/vars" script have not been tested

The added environment variables should not have negative side-effects. I'll test Windows installer generation tomorrow to make sure easy-rsa works out of the box on Windows. Help with *NIX+OpenSSL 1.0.0 and "domake-win" would be appreciated.

Samuli

Quoted 73 lines · Jan Just Keijser

[...snip...]

Quoted 1 line
Quoted 1 line

Samuli, can you please look closer into this? I did a more

careful diff

Quoted 8 lines
Quoted 7 lines

from 2.0/openssl.cnf and Windows/openssl.cnf ... and it seems quite different. Can we please unite them?

JJK: Do you know which differences are needed between Windows and non-Windows?

I just checked that the openssl.cnf file shipped with the windows

version

Quoted 1 line

of openvpn 2.1.4 is identical to the easy-rsa/2.0 version - is

there any

Quoted 1 line

reason not to do the same for openvpn 2.2?

Good question!

Samuli, what do you think? Could we actually just move the 2.0/openssl.cnf
to a common directory where the installers will pick this config file? To
have the same file in more places in the source tree sounds chaotic for me,
especially when 2.1.4 uses the same file everywhere.

I'd suggest ./easy-rsa as a good common base.

I'm also wondering if we need to still carry easy-rsa/1.0 in the source tree. It looks rather dead ...

$ git log --follow --oneline ./easy-rsa/1.0/
3c7f2f5 version 2.1_beta1

Compared to this:

$ git log --follow --oneline ./easy-rsa/2.0/
6dc6019 pkitool lacks expected option "--help"
2d4e768 bash->bourne script cleanup
564a210 Updated copyright date to 2010.
9f4725e pkitool lacks expected option "--help"
d7fa38f Update copyright to 2009.
2534aa4 Fixed revoke-full to deal with issue arising from addition ...
dbec0a2 Modified pkitool to allow flexibility in separating the Com...
d56dec6 Change to pkitool/openssl.cnf so that calling scripts can s...
367ed08 Copyright notice changed to reflect change in name of Telet...
1c0cc4a Copyright change OpenVPN Solutions LLC -> Telethra, Inc.
eca8691 Updated copyright notice to 2008.
4d90d73 Updated version & changelog.
d4fb6d4 Set tool defaults in pkitool.
eba4632 Added note about alternative version of easy-rsa that suppo...
8d54351 Clean up configure on FreeBSD for recent autotool versions ...
acb567c A few more updates: -r 1015:1025 https://svn.openvpn.net/pr...
a8105c6 Merged PKCS#11 extensions to easy-rsa/2.0  (Alon Bar-Lev). ...
513baee Small fixes: * Fixed variable declaration in crypto.c that ...
411e89a Merged --remote-cert-ku, --remote-cert-eku, and --remote-ce...
8810c26 Moved easy-rsa 2.0 scripts to easy-rsa/2.0 to be compatible...
$ git log --follow --oneline ./easy-rsa/Windows/
54c739e Revert "Add new openssl.cnf to easy-rsa/Windows"
663860a Add new openssl.cnf to easy-rsa/Windows
3810843 Fix a build-ca issue on Windows
6b2883a Change all CRLF linefeeds to LF linefeeds
d0b4271 In Windows build, package a statically linked openssl.exe t...
4030142 The easy-rsa directory installed by the windows installer c...
6fbf66f This is the start of the BETA21 branch. It includes the --t...

kind regards,

David Sommerseth

#9 lore raw
In reply to [email protected]...

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

Quoted 8 lines · On 17/06/11 11:18, [email protected]... wrote:

From: Samuli Seppänen <[email protected]...>

Fixes Trac ticket #125

---
 easy-rsa/Windows/init-config.bat |    1 -
 win/openvpn.nsi                  |    5 +++--
 2 files changed, 3 insertions(+), 3 deletions(-)

ACK. Applied to master and release/2.2.

commit 38108434db7b2d574133dd645d01df03848532d6 (master) commit 09282a688bd16d1572a7cc4fd20d3785fb2b4c1e (release/2.2)

Author: Samuli Seppänen <[email protected]...>
Date:   Fri Jun 17 12:18:02 2011 +0300
    Fix a build-ca issue on Windows

    Fixes Trac ticket #125

    Signed-off-by: Samuli Seppänen <[email protected]...>
    Acked-by: David Sommerseth <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

Trac reference: <https://community.openvpn.net/openvpn/ticket/125>

kind regards,

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

iEYEARECAAYFAk3/EgUACgkQDC186MBRfrr3jACfWhWA5sIYhkI61z+w9Q/BE4ag 6gsAnj7Jj1Ca39mko64iqyyPpgcZXdyq
=sg9T
-----END PGP SIGNATURE-----

#10 lore raw

[Openvpn-devel] Fixes to Trac ticket #125

In reply to [email protected]...

These patches fix remaining outstanding easy-rsa issues. The first patch fixes Trac ticket #125 and the second patch fixes a regression caused by the first one in domake-win / MinGW builds.

These patches do not address the issue that domake-win build system is somewhat outdated and won't work without several undocumented manual steps.

#11 lore raw

PATCH 1/2 Updated "easy-rsa" for OpenSSL 1.0.0

From: Samuli Seppänen <[email protected]...>

This patch fixes remaining issues with Trac ticket #125. It does the following:

- Update easy-rsa/2.0/README
- Rename easy-rsa/2.0/openssl.cnf as openssl-0.9.8.cnf
- Add easy-rsa/2.0/openssl-1.0.0.cnf
- Updated vars.bat.sample to use openssl-1.0.0.cnf
- Updated win/openvpn.nsi to use openssl-1.0.0.cnf
- Add a few undefined variables to vars and vars.bat.sample:
required by OpenSSL 1.0.0 (at least on Windows)

---
 easy-rsa/2.0/README              |    4 +-
 easy-rsa/2.0/openssl-1.0.0.cnf   |  285 +++++++++++++++++++++++++++++++++++++
 easy-rsa/2.0/openssl.cnf         |  291 --------------------------------------
 easy-rsa/2.0/vars                |    6 +
 easy-rsa/Windows/vars.bat.sample |    7 +-
 win/openvpn.nsi                  |    2 +-
 6 files changed, 300 insertions(+), 295 deletions(-)
 create mode 100755 easy-rsa/2.0/openssl-1.0.0.cnf
 delete mode 100755 easy-rsa/2.0/openssl.cnf
easy-rsa/2.0/README +2 -2
index bde0d8c..6f5395c 100644
@@ -74,8 +74,8 @@ Release Notes for easy-rsa-2.0
 INSTALL easy-rsa
 
 1. Edit vars.
-2. Set KEY_CONFIG to point to the openssl.cnf file
-   included in this distribution.
+2. Set KEY_CONFIG to point to the correct openssl-<version>.cnf
+   file included in this distribution.
 3. Set KEY_DIR to point to a directory which will
    contain all keys, certificates, etc.  This
    directory need not exist, and if it does,
easy-rsa/2.0/openssl-1.0.0.cnf new file +285 -0

285 lines not on this page · raw message

easy-rsa/2.0/openssl.cnf deleted +0 -291

291 lines not on this page · raw message

easy-rsa/2.0/vars +6 -0
index cded885..2ea1ced 100755
@@ -66,3 +66,9 @@ export KEY_PROVINCE="CA"
 export KEY_CITY="SanFrancisco"
 export KEY_ORG="Fort-Funston"
 export KEY_EMAIL="[email protected]..."
+export [email protected]...
+export KEY_CN=changeme
+export KEY_NAME=changeme
+export KEY_OU=changeme
+export PKCS11_MODULE_PATH=changeme
+export PKCS11_PIN=1234
easy-rsa/Windows/vars.bat.sample +6 -1
index 3c4b607..36e6f71 100644
@@ -4,7 +4,7 @@ rem the openssl.cnf file included
 rem with easy-rsa.
 
 set HOME=%ProgramFiles%\OpenVPN\easy-rsa
-set KEY_CONFIG=openssl.cnf
+set KEY_CONFIG=openssl-1.0.0.cnf
 
 rem Edit this variable to point to
 rem your soon-to-be-created key
@@ -33,3 +33,8 @@ set KEY_PROVINCE=CA
 set KEY_CITY=SanFrancisco
 set KEY_ORG=OpenVPN
 set [email protected]...
+set KEY_CN=changeme
+set KEY_NAME=changeme
+set KEY_OU=changeme
+set PKCS11_MODULE_PATH=changeme
+set PKCS11_PIN=1234
win/openvpn.nsi +1 -1
index 82be118..13c04f2 100755
@@ -274,7 +274,7 @@ Section "${PRODUCT_NAME} RSA Certificate Management Scripts" SecOpenVPNEasyRSA
 
   # Original nsi script looked for ${EASYRSA}\2.0\openssl.cnf.sample. A newer 
   # openssl.cnf is needed on OpenVPN 2.2+.
-  File "${EASYRSA}\Windows\openssl.cnf"
+  File "${EASYRSA}\2.0\openssl-1.0.0.cnf"
 
   File "${EASYRSA}\Windows\vars.bat.sample"
 
Signature · 1 line
1.7.4.1
#12 lore raw

PATCH 2/2 Made domake-win builds to use easy-rsa/2.0/openssl-1.0.0.cnf

In reply to [email protected]...

From: Samuli Seppänen <[email protected]...>

---
 install-win32/Makefile.am |    6 +++---
 install-win32/openvpn.nsi |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
install-win32/Makefile.am +3 -3
index 7211de2..75932fe 100644
@@ -57,7 +57,7 @@ nodist_doc_DATA = tmp/license.txt
 
 confdir = $(win32datadir)/config
 nodist_conf_DATA = \
-	tmp/openssl.cnf.sample \
+	tmp/openssl-1.0.0.cnf \
 	tmp/client.ovpn \
 	tmp/server.ovpn
 dist_conf_DATA = \
@@ -83,8 +83,8 @@ tmp/server.ovpn:	tmp $(top_srcdir)/sample-config-files/server.conf
 tmp/license.txt:	tmp $(top_srcdir)/COPYING $(top_srcdir)/COPYRIGHT.GPL
 	cat $(top_srcdir)/COPYING $(top_srcdir)/COPYRIGHT.GPL > tmp/license.txt
 
-tmp/openssl.cnf.sample:	tmp $(top_srcdir)/easy-rsa/2.0/openssl.cnf
-	cp $(top_srcdir)/easy-rsa/2.0/openssl.cnf tmp/openssl.cnf.sample
+tmp/openssl-1.0.0.cnf:	tmp $(top_srcdir)/easy-rsa/2.0/openssl-1.0.0.cnf
+	cp $(top_srcdir)/easy-rsa/2.0/openssl-1.0.0.cnf tmp/openssl-1.0.0.cnf
 
 clean-local:
 	-rm -fr tmp
install-win32/openvpn.nsi +2 -2
index b6e4a07..f06c5aa 100755
@@ -333,7 +333,7 @@ Section "${PRODUCT_NAME} RSA Certificate Management Scripts" SecOpenVPNEasyRSA
   SetOverwrite on
   SetOutPath "$INSTDIR\easy-rsa"
 
-  File "${GEN}\easy-rsa\openssl.cnf.sample"
+  File "${GEN}\easy-rsa\openssl-1.0.0.cnf"
   File "${GEN}\easy-rsa\vars.bat.sample"
 
   File "${GEN}\easy-rsa\init-config.bat"
@@ -850,7 +850,7 @@ Section "Uninstall"
   Delete "$INSTDIR\license.txt"
   Delete "$INSTDIR\Uninstall.exe"
 
-  Delete "$INSTDIR\easy-rsa\openssl.cnf.sample"
+  Delete "$INSTDIR\easy-rsa\openssl-1.0.0.cnf"
   Delete "$INSTDIR\easy-rsa\vars.bat.sample"
   Delete "$INSTDIR\easy-rsa\init-config.bat"
   Delete "$INSTDIR\easy-rsa\README.txt"
Signature · 1 line
1.7.4.1
#13 lore raw

PATCH 1/1 Fixes to easy-rsa/2.0

In reply to [email protected]...

From: Samuli Seppänen <[email protected]...>

As support for OpenSSL 1.0.0 requires a modified openssl.cnf file, it was decided to rename openssl.cnf to openssl-1.0.0.cnf for clarity and better support of different OpenSSL versions. The old openssl.cnf was renamed as openssl-0.9.8.cnf.

This patch makes sure that all openssl*.cnf files are copied when running 'make install' in easy-rsa and makes the whichopensslcnf script aware of them as well.

---
 easy-rsa/2.0/Makefile          |    2 +-
 easy-rsa/2.0/openssl-0.9.8.cnf |  291 ++++++++++++++++++++++++++++++++++++++++
 easy-rsa/2.0/whichopensslcnf   |   23 +++-
 3 files changed, 310 insertions(+), 6 deletions(-)
 create mode 100755 easy-rsa/2.0/openssl-0.9.8.cnf
easy-rsa/2.0/Makefile +1 -1
index 125ac51..8000cc5 100644
@@ -10,4 +10,4 @@ install:
 	install -d "${DESTDIR}/${PREFIX}"
 	install -m 0755 build-* "${DESTDIR}/${PREFIX}"
 	install -m 0755 clean-all list-crl inherit-inter pkitool revoke-full sign-req whichopensslcnf "${DESTDIR}/${PREFIX}"
-	install -m 0644 openssl-0.9.6.cnf openssl.cnf README vars "${DESTDIR}/${PREFIX}"
+	install -m 0644 openssl-0.9.6.cnf openssl-0.9.8.cnf openssl-1.0.0.cnf README vars "${DESTDIR}/${PREFIX}"
easy-rsa/2.0/openssl-0.9.8.cnf new file +291 -0

291 lines not on this page · raw message

easy-rsa/2.0/whichopensslcnf +18 -5
index 2260aa8..3809241 100755
@@ -1,13 +1,26 @@
 #!/bin/sh
 
+cnf="$1/openssl.cnf"
+
 if [ "$OPENSSL" ]; then
-	if $OPENSSL version | grep 0.9.6 > /dev/null; then
-		echo "$1/openssl-0.9.6.cnf"
+	if $OPENSSL version |grep -E "0\.9\.6[[:alnum:]]" > /dev/null; then
+		cnf="$1/openssl-0.9.6.cnf"
+	elif $OPENSSL version |grep -E "0\.9\.8[[:alnum:]]" > /dev/null; then
+		cnf="$1/openssl-0.9.8.cnf"
+	elif $OPENSSL version | grep -E "1\.0\.([[:digit:]][[:alnum:]])" > /dev/null; then
+                cnf="$1/openssl-1.0.0.cnf"
 	else
-		echo "$1/openssl.cnf"
+		cnf="$1/openssl.cnf"
 	fi
-else
-	echo "$1/openssl.cnf"
+fi
+
+echo $cnf
+
+if [ ! -r $cnf ]; then
+    echo "**************************************************************" >&2
+    echo "  No $cnf file could be found" >&2
+    echo "  Further invocations will fail" >&2
+    echo "**************************************************************" >&2
 fi
 
 exit 0
Signature · 1 line
1.7.4.1
#14 lore raw

Re: [Openvpn-devel] [PATCH] Fixes to easy-rsa/2.0

Am 30.06.2011 09:59, schrieb [email protected]...:

Quoted 6 lines

From: Samuli Seppänen <[email protected]...>

As support for OpenSSL 1.0.0 requires a modified openssl.cnf file, it was decided to rename openssl.cnf to openssl-1.0.0.cnf for clarity and better support of different OpenSSL versions. The old openssl.cnf was renamed as openssl-0.9.8.cnf.

But: Whence the need to keep support for 0.9.6?

#15 lore raw

Re: [Openvpn-devel] [PATCH] Fixes to easy-rsa/2.0

Quoted 9 lines

Am 30.06.2011 09:59, schrieb [email protected]...:

Quoted 6 lines

From: Samuli Seppänen <[email protected]...>

As support for OpenSSL 1.0.0 requires a modified openssl.cnf file, it was decided to rename openssl.cnf to openssl-1.0.0.cnf for clarity and better support of different OpenSSL versions. The old openssl.cnf was renamed as openssl-0.9.8.cnf.

But: Whence the need to keep support for 0.9.6?

We'll ask James about that in today's meeting:

<https://community.openvpn.net/openvpn/wiki/Topics-2011-06-30>

I don't see any reason why OpenSSL 0.9.6 should be supported: it's last maintenance release was made in 2004.

Signature · 5 lines
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock
#16 lore raw

Re: [Openvpn-devel] [PATCH] Fixes to easy-rsa/2.0

In reply to Matthias Andree

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

Quoted 10 lines · Matthias Andree

Am 30.06.2011 09:59, schrieb [email protected]...:

Quoted 6 lines

From: Samuli Seppänen <[email protected]...>

As support for OpenSSL 1.0.0 requires a modified openssl.cnf file, it was decided to rename openssl.cnf to openssl-1.0.0.cnf for clarity and better support of different OpenSSL versions. The old openssl.cnf was renamed as openssl-0.9.8.cnf.

But: Whence the need to keep support for 0.9.6?

Agreed, and we decided yesterday in the developers meeting to remove 0.9.6 support. However we found it better to remove that support first in OpenVPN 2.3, as we will then go through the source code and remove all 0.9.6 related stuff in the same go. We don't want to change this in a stable release.

kind regards,

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

iEYEARECAAYFAk4NhLIACgkQDC186MBRfrqaewCgiuSHDJhwc4pA9U0uSxNij5tM WCsAn0cA50Ya0F9zy/pqMGj4wxzkxSqr
=9kuQ
-----END PGP SIGNATURE-----

#17 lore raw

Re: [Openvpn-devel] [PATCH] Fixes to easy-rsa/2.0

Am 01.07.2011 10:26, schrieb David Sommerseth:

Quoted 5 lines

Agreed, and we decided yesterday in the developers meeting to remove 0.9.6 support. However we found it better to remove that support first in OpenVPN 2.3, as we will then go through the source code and remove all 0.9.6 related stuff in the same go. We don't want to change this in a stable release.

Alright, sounds very reasonable.