Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take Windows User "TEMP" variable for $EASYRSA_TEMP_DIR fallback #413

Closed
wants to merge 5 commits into from
Closed

Take Windows User "TEMP" variable for $EASYRSA_TEMP_DIR fallback #413

wants to merge 5 commits into from

Conversation

TinCanTech
Copy link
Collaborator

Signed-off-by: Richard Bonhomme tincanteksup@gmail.com

Signed-off-by: Richard Bonhomme <tincanteksup@gmail.com>
@TinCanTech
Copy link
Collaborator Author

This generally fixes #412

@TinCanTech
Copy link
Collaborator Author

I forgot to shellcheck it ..

Signed-off-by: Richard Bonhomme <tincanteksup@gmail.com>
@TinCanTech
Copy link
Collaborator Author

TinCanTech commented Oct 27, 2020

Windows log (With some debugging):


C:\Program Files\OpenVPN\easy-rsa>EasyRSA-Start.bat

Welcome to the EasyRSA 3 Shell for Windows.
Easy-RSA 3 is available under a GNU GPLv2 license.

Invoke './easyrsa' to call the program. Without commands, help is displayed.

EasyRSA Shell
# ./easyrsa init-pki


WARNING!!!

You are about to remove the EASYRSA_PKI at: C:/Program Files/OpenVPN/easy-rsa/pk
i
and initialize a fresh PKI here.

Type the word 'yes' to continue, or any other input to abort.
  Confirm removal: yes
path = C:/Users/IEUser/AppData/Local/Temp/easy-rsa-2444.a02884/tmp.XXXXXX
lpPathBuffer = C:\Users\IEUser\AppData\Local\Temp\
szTempName = C:\Users\IEUser\AppData\Local\Temp\tmp6DEE.tmp
path = C:\Users\IEUser\AppData\Local\Temp\tmp6DEE.tmp
fd = 5

init-pki complete; you may now create a CA or requests.
Your newly created PKI dir is: C:/Program Files/OpenVPN/easy-rsa/pki



EasyRSA Shell
# ./easyrsa build-ca
Using SSL: openssl OpenSSL 1.1.1h  22 Sep 2020
path = C:/Users/IEUser/AppData/Local/Temp/easy-rsa-2152.a00784/tmp.XXXXXX
lpPathBuffer = C:\Users\IEUser\AppData\Local\Temp\
szTempName = C:\Users\IEUser\AppData\Local\Temp\tmp926D.tmp
path = C:\Users\IEUser\AppData\Local\Temp\tmp926D.tmp
fd = 4
path = C:/Users/IEUser/AppData/Local/Temp/easy-rsa-2152.a00784/tmp.XXXXXX
lpPathBuffer = C:\Users\IEUser\AppData\Local\Temp\
szTempName = C:\Users\IEUser\AppData\Local\Temp\tmp92EA.tmp
path = C:\Users\IEUser\AppData\Local\Temp\tmp92EA.tmp
fd = 4
path = C:/Users/IEUser/AppData/Local/Temp/easy-rsa-2152.a00784/tmp.XXXXXX
lpPathBuffer = C:\Users\IEUser\AppData\Local\Temp\
szTempName = C:\Users\IEUser\AppData\Local\Temp\tmp9348.tmp
path = C:\Users\IEUser\AppData\Local\Temp\tmp9348.tmp
fd = 4

Enter New CA Key Passphrase:
Re-Enter New CA Key Passphrase:
openssl genrsa -out C:/Users/IEUser/AppData/Local/Temp/easy-rsa-2152.a00784/tmp.
a03136 -aes256 -passout file:C:/Users/IEUser/AppData/Local/Temp/easy-rsa-2152.a0
0784/tmp.a03260 2048
Generating RSA private key, 2048 bit long modulus (2 primes)
.............................................................+++++
........................................................+++++
e is 65537 (0x010001)
path = C:/Users/IEUser/AppData/Local/Temp/easy-rsa-2152.a00784/tmp.XXXXXX
lpPathBuffer = C:\Users\IEUser\AppData\Local\Temp\
szTempName = C:\Users\IEUser\AppData\Local\Temp\tmpA75D.tmp
path = C:\Users\IEUser\AppData\Local\Temp\tmpA75D.tmp
fd = 5
openssl req -config C:/Users/IEUser/AppData/Local/Temp/easy-rsa-2152.a00784/tmp.
a00340 -utf8 -new -key C:/Users/IEUser/AppData/Local/Temp/easy-rsa-2152.a00784/t
mp.a03136 -keyout C:/Users/IEUser/AppData/Local/Temp/easy-rsa-2152.a00784/tmp.a0
3136 -out C:/Users/IEUser/AppData/Local/Temp/easy-rsa-2152.a00784/tmp.a03856 -pa
ssin file:C:/Users/IEUser/AppData/Local/Temp/easy-rsa-2152.a00784/tmp.a03260 -x5
09 -days 3650
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Common Name (eg: your user, host, or server name) [Easy-RSA CA]:

CA creation complete and you may now import and sign cert requests.
Your new CA certificate file for publishing is at:
C:/Program Files/OpenVPN/easy-rsa/pki/ca.crt



EasyRSA Shell
#

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
When using Windows, the current working directory is not reliably
evaluated.  This can be due to user error or possible script bugs.
This means that the variable EASYRSA may have an incorrect value,
which causes EASYRSA_EXT_DIR to point to an invalid location.

Currently, the value of EASYRSA_EXT_DIR is assumed to be correct,
without verification.

Always verify that x509-types folder can be found or error-exit.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
@TinCanTech
Copy link
Collaborator Author

I expect 69b7891 is the reason this cannot be merged. Closing this to do a cleaner PR.

@TinCanTech TinCanTech closed this Nov 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant