Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions easy-rsa/Windows/build-ca-pass.bat
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@echo off
cd %HOME%
cd "%HOME%"
rem build a request for a cert that will be valid for ten years
openssl req -days 3650 -new -keyout %KEY_DIR%\%1.key -out %KEY_DIR%\%1.csr -config %KEY_CONFIG%
openssl req -days 3650 -new -keyout "%KEY_DIR%\%1.key" -out "%KEY_DIR%\%1.csr" -config "%KEY_CONFIG%"
rem sign the cert request with our ca, creating a cert/key pair
openssl ca -days 3650 -out %KEY_DIR%\%1.crt -in %KEY_DIR%\%1.csr -config %KEY_CONFIG%
openssl ca -days 3650 -out "%KEY_DIR%\%1.crt" -in "%KEY_DIR%\%1.csr" -config "%KEY_CONFIG%"
rem delete any .old files created in this process, to avoid future file creation errors
del /q %KEY_DIR%\*.old
del /q "%KEY_DIR%\*.old"
4 changes: 2 additions & 2 deletions easy-rsa/Windows/build-ca.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@echo off
cd %HOME%
cd "%HOME%"
rem build a cert authority valid for ten years, starting now
openssl req -days 3650 -nodes -new -x509 -keyout %KEY_DIR%\ca.key -out %KEY_DIR%\ca.crt -config %KEY_CONFIG%
openssl req -days 3650 -nodes -new -x509 -keyout "%KEY_DIR%\ca.key" -out "%KEY_DIR%\ca.crt" -config "%KEY_CONFIG%"
4 changes: 2 additions & 2 deletions easy-rsa/Windows/build-dh.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@echo off
cd %HOME%
cd "%HOME%"
rem build a dh file for the server side
openssl dhparam -out %KEY_DIR%/dh%KEY_SIZE%.pem %KEY_SIZE%
openssl dhparam -out "%KEY_DIR%/dh%KEY_SIZE%.pem" %KEY_SIZE%
8 changes: 4 additions & 4 deletions easy-rsa/Windows/build-key-pass.bat
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@echo off
cd %HOME%
cd "%HOME%"
rem build a request for a cert that will be valid for ten years
openssl req -days 3650 -new -keyout %KEY_DIR%\%1.key -out %KEY_DIR%\%1.csr -config %KEY_CONFIG%
openssl req -days 3650 -new -keyout "%KEY_DIR%\%1.key" -out "%KEY_DIR%\%1.csr" -config "%KEY_CONFIG%"
rem sign the cert request with our ca, creating a cert/key pair
openssl ca -days 3650 -out %KEY_DIR%\%1.crt -in %KEY_DIR%\%1.csr -config %KEY_CONFIG%
openssl ca -days 3650 -out "%KEY_DIR%\%1.crt" -in "%KEY_DIR%\%1.csr" -config "%KEY_CONFIG%"
rem delete any .old files created in this process, to avoid future file creation errors
del /q %KEY_DIR%\*.old
del /q "%KEY_DIR%\*.old"
10 changes: 5 additions & 5 deletions easy-rsa/Windows/build-key-pkcs12.bat
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@echo off
cd %HOME%
cd "%HOME%"
rem build a request for a cert that will be valid for ten years
openssl req -days 3650 -nodes -new -keyout %KEY_DIR%\%1.key -out %KEY_DIR%\%1.csr -config %KEY_CONFIG%
openssl req -days 3650 -nodes -new -keyout "%KEY_DIR%\%1.key" -out "%KEY_DIR%\%1.csr" -config "%KEY_CONFIG%"
rem sign the cert request with our ca, creating a cert/key pair
openssl ca -days 3650 -out %KEY_DIR%\%1.crt -in %KEY_DIR%\%1.csr -config %KEY_CONFIG%
openssl ca -days 3650 -out "%KEY_DIR%\%1.crt" -in "%KEY_DIR%\%1.csr" -config "%KEY_CONFIG%"
rem convert the key/cert and embed the ca cert into a pkcs12 file.
openssl pkcs12 -export -inkey %KEY_DIR%\%1.key -in %KEY_DIR%\%1.crt -certfile %KEY_DIR%\ca.crt -out %KEY_DIR%\%1.p12
openssl pkcs12 -export -inkey "%KEY_DIR%\%1.key" -in "%KEY_DIR%\%1.crt" -certfile "%KEY_DIR%\ca.crt" -out "%KEY_DIR%\%1.p12"
rem delete any .old files created in this process, to avoid future file creation errors
del /q %KEY_DIR%\*.old
del /q "%KEY_DIR%\*.old"
8 changes: 4 additions & 4 deletions easy-rsa/Windows/build-key-server-pass.bat
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@echo off
cd %HOME%
cd "%HOME%"
rem build a request for a cert that will be valid for ten years
openssl req -days 3650 -new -keyout %KEY_DIR%\%1.key -out %KEY_DIR%\%1.csr -config %KEY_CONFIG%
openssl req -days 3650 -new -keyout "%KEY_DIR%\%1.key" -out "%KEY_DIR%\%1.csr" -config "%KEY_CONFIG%"
rem sign the cert request with our ca, creating a cert/key pair
openssl ca -days 3650 -out %KEY_DIR%\%1.crt -in %KEY_DIR%\%1.csr -extensions server -config %KEY_CONFIG%
openssl ca -days 3650 -out "%KEY_DIR%\%1.crt" -in "%KEY_DIR%\%1.csr" -extensions server -config "%KEY_CONFIG%"
rem delete any .old files created in this process, to avoid future file creation errors
del /q %KEY_DIR%\*.old
del /q "%KEY_DIR%\*.old"
8 changes: 4 additions & 4 deletions easy-rsa/Windows/build-key-server.bat
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@echo off
cd %HOME%
cd "%HOME%"
rem build a request for a cert that will be valid for ten years
openssl req -days 3650 -nodes -new -keyout %KEY_DIR%\%1.key -out %KEY_DIR%\%1.csr -config %KEY_CONFIG%
openssl req -days 3650 -nodes -new -keyout "%KEY_DIR%\%1.key" -out "%KEY_DIR%\%1.csr" -config "%KEY_CONFIG%"
rem sign the cert request with our ca, creating a cert/key pair
openssl ca -days 3650 -out %KEY_DIR%\%1.crt -in %KEY_DIR%\%1.csr -extensions server -config %KEY_CONFIG%
openssl ca -days 3650 -out "%KEY_DIR%\%1.crt" -in "%KEY_DIR%\%1.csr" -extensions server -config "%KEY_CONFIG%"
rem delete any .old files created in this process, to avoid future file creation errors
del /q %KEY_DIR%\*.old
del /q "%KEY_DIR%\*.old"
8 changes: 4 additions & 4 deletions easy-rsa/Windows/build-key.bat
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@echo off
cd %HOME%
cd "%HOME%"
rem build a request for a cert that will be valid for ten years
openssl req -days 3650 -nodes -new -keyout %KEY_DIR%\%1.key -out %KEY_DIR%\%1.csr -config %KEY_CONFIG%
openssl req -days 3650 -nodes -new -keyout "%KEY_DIR%\%1.key" -out "%KEY_DIR%\%1.csr" -config "%KEY_CONFIG%"
rem sign the cert request with our ca, creating a cert/key pair
openssl ca -days 3650 -out %KEY_DIR%\%1.crt -in %KEY_DIR%\%1.csr -config %KEY_CONFIG%
openssl ca -days 3650 -out "%KEY_DIR%\%1.crt" -in "%KEY_DIR%\%1.csr" -config "%KEY_CONFIG%"
rem delete any .old files created in this process, to avoid future file creation errors
del /q %KEY_DIR%\*.old
del /q "%KEY_DIR%\*.old"
10 changes: 5 additions & 5 deletions easy-rsa/Windows/clean-all.bat
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
@echo off
rem move to the HOME directory specified in VARS script
cd %HOME%
cd "%HOME%"
rem set a temporary KEY_DIR variable
set d=%KEY_DIR%
rem delete the KEY_DIR and any subdirs quietly
rmdir /s /q %d%
rmdir /s /q "%d%"
rem make a new KEY_DIR
mkdir %d%
mkdir "%d%"
rem copy in a fesh index file so we begin with an empty database
copy index.txt.start %d%\index.txt
copy index.txt.start "%d%\index.txt"
rem copy in a fresh serial file so we begin generating keys at index 01
copy serial.start %d%\serial.
copy serial.start "%d%\serial."
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely sure what this line i supposed to do. Does it really just copy serial.start to serial.? What is the point of having the dot at the end of the filename?

12 changes: 6 additions & 6 deletions easy-rsa/Windows/revoke-full.bat
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
@echo off
cd %HOME%
cd "%HOME%"
rem revoke cert
openssl ca -revoke %KEY_DIR%\%1.crt -config %KEY_CONFIG%
openssl ca -revoke "%KEY_DIR%\%1.crt" -config "%KEY_CONFIG%"
rem generate new crl
openssl ca -gencrl -out %KEY_DIR%\crl.pem -config %KEY_CONFIG%
openssl ca -gencrl -out "%KEY_DIR%\crl.pem" -config "%KEY_CONFIG%"
rem test revocation
rem first concatinate ca cert with newly generated crl
copy %KEY_DIR%\ca.crt+%KEY_DIR%\crl.pem %KEY_DIR%\revoke_test_file.pem
copy "%KEY_DIR%\ca.crt"+"%KEY_DIR%\crl.pem" "%KEY_DIR%\revoke_test_file.pem"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to this page the "+" operator concatenates files together. Is this the correct way to quote this command?

rem now verify the revocation
openssl verify -CAfile %KEY_DIR%\revoke_test_file.pem -crl_check %KEY_DIR%\%1.crt
openssl verify -CAfile "%KEY_DIR%\revoke_test_file.pem" -crl_check "%KEY_DIR%\%1.crt"
rem delete temporary test file
del /q %KEY_DIR%\revoke_test_file.pem
del /q "%KEY_DIR%\revoke_test_file.pem"