742 Commits

Author SHA1 Message Date
Luiz Angelo Daros de Luca
12ee30a802
check for failed easyrsa_mktemp
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2019-05-30 18:52:27 -03:00
Rolf
951ce27ccf Merge branch 'master' of https://github.com/rolfchess/easy-rsa 2019-05-17 13:56:58 +02:00
Rolf
abaa2f57b4 Show helpful error when vars file is missing 2019-05-17 13:52:33 +02:00
Eric F Crist
8374fcb4da
Adding support back in for incremental serials
Not enabled by default.  Should fix #177.

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2019-05-17 06:50:08 -05:00
Olliver Schinagl
e21ed159a1
Use intermediate CA rather then sub CA
The term 'sub-ca' seems to be coined and used mostly/only by easyrsa.
More commonly, this type of certificate is called an intermediate CA
[0]. The term sub-ca, while logical is actually a Microsoft CA term [1].

The command itself remains the same for now, as it is shorter/easier to
type.

[0] https://en.wikipedia.org/w/index.php?title=Intermediate_certificate_authorities
[1] https://en.wikipedia.org/wiki/Public_key_infrastructure

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2019-05-17 10:31:26 +02:00
Olliver Schinagl
7f2936caf9
doc: Add signing example to the readme.
While it is documented in the quickstart, it was missing from the
readme, which is confusing as all other commands are shown with an
example in the document.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2019-05-17 10:15:46 +02:00
Eric F Crist
6b7b6bf1f0
Merge branch 'IPv4v6-x509-type-email'
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2019-05-06 22:41:27 -05:00
Eric F Crist
541c6d94ca Merge branch 'IPv4v6-x509-type-email'
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2019-05-06 22:41:27 -05:00
Eric F Crist
9c0c15d062
Merge branch 'x509-type-email' of https://github.com/IPv4v6/easy-rsa into IPv4v6-x509-type-email 2019-05-06 22:41:05 -05:00
Eric F Crist
d28ab306e8 Merge branch 'x509-type-email' of https://github.com/IPv4v6/easy-rsa into IPv4v6-x509-type-email 2019-05-06 22:41:05 -05:00
Eric F Crist
51ac28e19e
Merge branch 'luizluca-batch_ops'
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2019-05-06 22:38:01 -05:00
Eric F Crist
a020d4b3be Merge branch 'luizluca-batch_ops'
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2019-05-06 22:38:01 -05:00
Eric F Crist
bcec3b9ce6
Merge branch 'batch_ops' of https://github.com/luizluca/easy-rsa into luizluca-batch_ops 2019-05-06 22:37:01 -05:00
Eric F Crist
782fb42986 Merge branch 'batch_ops' of https://github.com/luizluca/easy-rsa into luizluca-batch_ops 2019-05-06 22:37:01 -05:00
Eric F Crist
c3853eefa4
Merge branch 'luizluca-fix_firstcert_warn'
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2019-05-06 22:32:53 -05:00
Eric F Crist
81aa0298a1 Merge branch 'luizluca-fix_firstcert_warn'
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2019-05-06 22:32:53 -05:00
Eric F Crist
5d87cdcfae
Merge branch 'fix_firstcert_warn' of https://github.com/luizluca/easy-rsa into luizluca-fix_firstcert_warn 2019-05-06 22:32:34 -05:00
Eric F Crist
e6c64675d5 Merge branch 'fix_firstcert_warn' of https://github.com/luizluca/easy-rsa into luizluca-fix_firstcert_warn 2019-05-06 22:32:34 -05:00
Eric F Crist
f56c81b584
Merge branch 'luizluca-temp_dir'
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2019-05-06 22:26:22 -05:00
Eric F Crist
048fd29a64 Merge branch 'luizluca-temp_dir'
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2019-05-06 22:26:22 -05:00
Eric F Crist
59f4923078
Merge branch 'temp_dir' of https://github.com/luizluca/easy-rsa into luizluca-temp_dir 2019-05-06 22:26:03 -05:00
Eric F Crist
09d9197579 Merge branch 'temp_dir' of https://github.com/luizluca/easy-rsa into luizluca-temp_dir 2019-05-06 22:26:03 -05:00
Eric F Crist
9d78538d30
Merge branch 'luizluca-fix_failed_buildfull_master'
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2019-05-06 22:19:54 -05:00
Eric F Crist
21459a2b8d Merge branch 'luizluca-fix_failed_buildfull_master'
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2019-05-06 22:19:54 -05:00
Eric F Crist
a4dc103a87
Merge branch 'fix_failed_buildfull_master' of https://github.com/luizluca/easy-rsa into luizluca-fix_failed_buildfull_master 2019-05-06 22:19:25 -05:00
Eric F Crist
a1348e6113 Merge branch 'fix_failed_buildfull_master' of https://github.com/luizluca/easy-rsa into luizluca-fix_failed_buildfull_master 2019-05-06 22:19:25 -05:00
Eric F Crist
c700e79905
Merge branch 'luizluca-follow_symblink'
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2019-05-06 21:46:46 -05:00
Eric F Crist
198ff1e722 Merge branch 'luizluca-follow_symblink'
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2019-05-06 21:46:46 -05:00
Eric F Crist
1899bcdc72
Merge branch 'follow_symblink' of https://github.com/luizluca/easy-rsa into luizluca-follow_symblink 2019-05-06 21:46:25 -05:00
Eric F Crist
d38f545de1 Merge branch 'follow_symblink' of https://github.com/luizluca/easy-rsa into luizluca-follow_symblink 2019-05-06 21:46:25 -05:00
Eric F Crist
942fa82a2a
Merge branch 'luizluca-fix_trap_exit_v2'
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2019-05-06 21:41:36 -05:00
Eric F Crist
1db9bf80ad Merge branch 'luizluca-fix_trap_exit_v2'
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2019-05-06 21:41:36 -05:00
Stefan Pietsch
d228fbc796 Set nonRepudiation bit for email certificates 2019-05-06 23:52:55 +02:00
Stefan Pietsch
4ee64ac3e3 Set nonRepudiation bit for email certificates 2019-05-06 23:52:55 +02:00
Stefan Pietsch
a2ae82477d Add x509-type for email certificates 2019-05-04 16:48:46 +02:00
Stefan Pietsch
9593009221 Add x509-type for email certificates 2019-05-04 16:48:46 +02:00
Luiz Angelo Daros de Luca
cdaa4a1fb0
include index.txt.attr as CA files
Remove a warning when the first certificate is generated

Can't open .../easy-rsa/pki/index.txt.attr for reading, No such file or directory

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2019-05-02 19:13:48 -03:00
Luiz Angelo Daros de Luca
8116178e4d include index.txt.attr as CA files
Remove a warning when the first certificate is generated

Can't open .../easy-rsa/pki/index.txt.attr for reading, No such file or directory

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2019-05-02 19:13:48 -03:00
Luiz Angelo Daros de Luca
52befc623f
fix prog_vars when easyrsa is symlink or in $PATH
When easyrsa in in $PATH, $0 does not contain a directory, resulting
in an invalid prog_vars. prog_vars is used to get default vars
location, if $EASYRSA_VARS_FILE, $EASYRSA_PKI/vars and $PWD/pki/vars
does not exist.

$0 is also used to set $EASYRSA the same way prog_vars is defined.

$EASYRSA/openssl-easyrsa.cnf is used to set $EASYRSA_SSL_CONF initial
content if missing.

$EASYRSA/x509-types is used to for extensions dir if $EASYRSA_EXT_DIR
and $EASYRSA_PKI/x509-types are not found. However, if vars already
needs changes, it is better to set $EASYRSA_EXT_DIR and file locations
there.

Normally a symlink to /usr/bin will be used to put easyrsa in $PATH.
Following $PATH and symlink allows easyrsa to be located in a more
standard dir like /usr/lib/easy-rsa/easyrsa and vars at
/usr/{lib,libexec,share}/easyrsa/vars, which could be a symlink to
/etc/easy-rsa/vars. vars can be easily appended with the default
distribution values.

With this patch, a system-wide easyrsa package could use this file
structure without patching easyrsa:

 /etc/easy-rsa/openssl-easyrsa.cnf
 /etc/easy-rsa/pki/
 /etc/easy-rsa/vars
 /usr/bin/easyrsa -> /usr/lib/easy-rsa/easyrsa
 /usr/lib/easy-rsa/easyrsa
 /usr/lib/easy-rsa/openssl-easyrsa.cnf
 /usr/lib/easy-rsa/vars -> /etc/easy-rsa/vars
 /usr/lib/easy-rsa/x509-types

If following symlink fails (win32), the previous behavior is used.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2019-05-02 19:08:08 -03:00
Luiz Angelo Daros de Luca
9d2f2417e0 fix prog_vars when easyrsa is symlink or in $PATH
When easyrsa in in $PATH, $0 does not contain a directory, resulting
in an invalid prog_vars. prog_vars is used to get default vars
location, if $EASYRSA_VARS_FILE, $EASYRSA_PKI/vars and $PWD/pki/vars
does not exist.

$0 is also used to set $EASYRSA the same way prog_vars is defined.

$EASYRSA/openssl-easyrsa.cnf is used to set $EASYRSA_SSL_CONF initial
content if missing.

$EASYRSA/x509-types is used to for extensions dir if $EASYRSA_EXT_DIR
and $EASYRSA_PKI/x509-types are not found. However, if vars already
needs changes, it is better to set $EASYRSA_EXT_DIR and file locations
there.

Normally a symlink to /usr/bin will be used to put easyrsa in $PATH.
Following $PATH and symlink allows easyrsa to be located in a more
standard dir like /usr/lib/easy-rsa/easyrsa and vars at
/usr/{lib,libexec,share}/easyrsa/vars, which could be a symlink to
/etc/easy-rsa/vars. vars can be easily appended with the default
distribution values.

With this patch, a system-wide easyrsa package could use this file
structure without patching easyrsa:

 /etc/easy-rsa/openssl-easyrsa.cnf
 /etc/easy-rsa/pki/
 /etc/easy-rsa/vars
 /usr/bin/easyrsa -> /usr/lib/easy-rsa/easyrsa
 /usr/lib/easy-rsa/easyrsa
 /usr/lib/easy-rsa/openssl-easyrsa.cnf
 /usr/lib/easy-rsa/vars -> /etc/easy-rsa/vars
 /usr/lib/easy-rsa/x509-types

If following symlink fails (win32), the previous behavior is used.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2019-05-02 19:08:08 -03:00
Luiz Angelo Daros de Luca
58b095454c
Remove req/privkey in build_full when sign_req fails
build_full leave req/privkey ig sign fails (i.e. when CA pass was
incorrect). If build_full fails, it should remove everything it created.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2019-05-02 19:03:47 -03:00
Luiz Angelo Daros de Luca
ad2510dc91 Remove req/privkey in build_full when sign_req fails
build_full leave req/privkey ig sign fails (i.e. when CA pass was
incorrect). If build_full fails, it should remove everything it created.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2019-05-02 19:03:47 -03:00
Luiz Angelo Daros de Luca
c794d5ebaa
add --passin --passout for alternative pass src/dst
Batch operations cannot be automated if openssl keeps asking
for a password. These new options allow the user to specify
a new source for password, using any openssl password options
like pass:1234 or env:var

Aborts build-ca if privkey generation fails.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2019-05-02 18:57:53 -03:00
Luiz Angelo Daros de Luca
132604f13f add --passin --passout for alternative pass src/dst
Batch operations cannot be automated if openssl keeps asking
for a password. These new options allow the user to specify
a new source for password, using any openssl password options
like pass:1234 or env:var

Aborts build-ca if privkey generation fails.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2019-05-02 18:57:53 -03:00
Luiz Angelo Daros de Luca
4ede9bf103
Add easyrsa_openssl as openssl wrap function
Most $EASYRSA_OPENSSL calls where replaced by easyrsa_openssl
calls. When OpenSSL config is needed, easyrsa_openssl generates
a temporary config in tempfiles, incorporating make_ssl_config and
$EASYRSA_EXTRA_EXTS usage.

vars_source_check and verify_ssl_lib use of make_ssl_config was
removed.

'export OPENSSL_CONF' was removed as every openssl call that might
need a conf now uses easyrsa_safessl.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2019-05-02 18:26:56 -03:00
Luiz Angelo Daros de Luca
0dd2bca711 Add easyrsa_openssl as openssl wrap function
Most $EASYRSA_OPENSSL calls where replaced by easyrsa_openssl
calls. When OpenSSL config is needed, easyrsa_openssl generates
a temporary config in tempfiles, incorporating make_ssl_config and
$EASYRSA_EXTRA_EXTS usage.

vars_source_check and verify_ssl_lib use of make_ssl_config was
removed.

'export OPENSSL_CONF' was removed as every openssl call that might
need a conf now uses easyrsa_safessl.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2019-05-02 18:26:56 -03:00
Luiz Angelo Daros de Luca
6ecb6f489e
use temporary directory instead of individual files
Manually managing temp files into fixes variables (EASYRSA_TEMP_FILE_*),
can result in errors like in build_ca that reused EASYRSA_TEMP_FILE_3.
A temporary directory simplify the cleanup.

A configurable directory for temp files (var EASYRSA_TEMP_DIR) also
allows the user to define a different temporary directory. This is
important for devices using flash disks that have limited number of
writes.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2019-05-02 18:26:56 -03:00
Luiz Angelo Daros de Luca
57f327b207 use temporary directory instead of individual files
Manually managing temp files into fixes variables (EASYRSA_TEMP_FILE_*),
can result in errors like in build_ca that reused EASYRSA_TEMP_FILE_3.
A temporary directory simplify the cleanup.

A configurable directory for temp files (var EASYRSA_TEMP_DIR) also
allows the user to define a different temporary directory. This is
important for devices using flash disks that have limited number of
writes.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2019-05-02 18:26:56 -03:00
Luiz Angelo Daros de Luca
d48618474b
cleanup and exit code when a signal is received
Merged clean_temp and prog_exit into cleanup, but removing
the exit call. Exit should not be called during EXIT as it will
overwrite the current exit code.

Trapped signals simply call "exit $((128+signal))" to force the
execution of EXIT (for non bash-shells).

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2019-05-02 18:23:53 -03:00
Luiz Angelo Daros de Luca
965165c99a cleanup and exit code when a signal is received
Merged clean_temp and prog_exit into cleanup, but removing
the exit call. Exit should not be called during EXIT as it will
overwrite the current exit code.

Trapped signals simply call "exit $((128+signal))" to force the
execution of EXIT (for non bash-shells).

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2019-05-02 18:23:53 -03:00