701 Commits

Author SHA1 Message Date
visuve
c7980daaa4 Add a note in EasyRSA-Advanced.md
- The global options need to be set before the actual commands
- https://github.com/OpenVPN/easy-rsa/blob/master/easyrsa3/easyrsa#L219
2020-06-28 16:33:45 +03:00
Eric F Crist
e68faed0a3
Feature: --passin for update-db operations with CA
Merge branch 'madmajestro-use-passin-update-db'

Adds support for leveraging the --passin option for the CA private key
password when running the update-db command.

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-05-12 22:25:53 -05:00
Eric F Crist
eb370fe4cd
Merge branch 'use-passin-update-db' of https://github.com/madmajestro/easy-rsa into madmajestro-use-passin-update-db 2020-05-12 22:24:51 -05:00
Eric F Crist
358fa06c15
Fix: Return in set_pass() always non-zero in batch
Merge branch 'madmajestro-setpass-never-returns-0-in-batchmode'

Similar bug to what was fixed in 2953817, with the same fix.

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-05-12 22:22:19 -05:00
Eric F Crist
d2f2735f6a
Merge branch 'setpass-never-returns-0-in-batchmode' of https://github.com/madmajestro/easy-rsa into madmajestro-setpass-never-returns-0-in-batchmode 2020-05-12 22:20:50 -05:00
Eric F Crist
2953817e45
Fix: notice() and warn() returned error in batch
Merge branch 'madmajestro-imrove-returncode-notice-and-warn'

This resolves a bug where the warn() and notice() functions would
produce a non-zero exit during batch mode operations.  This bug was
introduced by me in 09e2c3b.

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-05-12 22:17:44 -05:00
Arndt Kaiser
0044e1dc7c Functions notice() and warn() return with success now
The functions notice() and warn() allways exited with an return-code !=
0 if called in batch-mode, which can cause unexpected behavior in the
calling code. Now it is ensured that they return with succes.

Additinally, the Script will now terminate if the printf command in the
function print() fails. This ensures that errors during
output-generation will not be ignored.
2020-05-12 08:49:07 +02:00
Arndt Kaiser
cd69645b32 Function set_pass() now returns 0 on success in batch-mode
If changing passwords in batch-mode, the commands set-rsa-pass and
set-ec-pass allways returned with an exit code != 0 on success.

The origin for this is the implementation of the function notice() which
allway returns an return-code != 0 if called in batch-mode.

This patch fixes the bug by adding a return 0 at the end of set_pass(),
because this is the way this behaviour is fixed in other functions. I
will provide an additional pull-request to improve the functions
notice() and warn().
2020-05-11 08:20:04 +02:00
Arndt Kaiser
09637e3243 Don't ask for ca-password during update-db if EASYRSA_PASSIN is set
Now it is possible to run the command update-db without being asked for
the ca-password, if the option --passin is provided at the command line.
2020-05-10 20:04:48 +02:00
Eric F Crist
c505a14be5
op_test.sh will now exit with status of unit tests
Fixed an issue where op_test.sh would exit with the status of the rm
command from cleanup, rather than from the unit tests it was running.

Closes #355

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-04-14 22:07:14 -05:00
Eric F Crist
2d0e10144f
Update ChangeLog for v3.0.8
Update coming soon.

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-04-14 22:00:16 -05:00
Eric F Crist
9827c7dc3f
Add support for export-p8
Merge branch 'nkakouros-pkcs8' (#340)

Closes #339

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-04-14 21:06:18 -05:00
Eric F Crist
2189cc6f99
Merge branch 'pkcs8' of https://github.com/nkakouros/easy-rsa into nkakouros-pkcs8 2020-04-14 20:52:06 -05:00
Eric F Crist
fc608b0f2d
Merge branch 'InsaneScientist-fix-ed25519'
When Edwards curves are currently specified, they will be used for the
signature algorithm, but the actual public/private keypair will fall
back to defaults (RSA2048), which is likely not what the user intends.

This commit modifies the code so that requesting Edwards curves will
result in their use for the Public Key Algorithm (new behavior) in
addition to the Signature Algorithm (current behavior)

Examples of fixed and current (broken) behavior given below. Note the
Public Key Algorithm in the middle of the certificate and the message
from openssl of the private key type that's being generated

==> This still doesn't appear to fix the issue when generating
    certificates on macOS with LibreSSL.  I haven't looked too far into
    this, though.

Address OpenSSL in #350, needs more attention.

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-04-14 20:28:57 -05:00
Eric F Crist
8eeb0d2628
Use same algorithm for signature as pub/priv keys
When Edwards curves are currently specified, they will be used for the
signature algorithm, but the actual public/private keypair will fall
back to defaults (RSA2048), which is likely not what the user intends.

This commit modifies the code so that requesting Edwards curves will
result in their use for the Public Key Algorithm (new behavior) in
addition to the Signature Algorithm (current behavior)

Examples of fixed and current (broken) behavior given below. Note the
Public Key Algorithm in the middle of the certificate and the message
from openssl of the private key type that's being generated:

Merge branch 'fix-ed25519' of https://github.com/InsaneScientist/easy-rsa into InsaneScientist-fix-ed25519
2020-04-14 20:19:38 -05:00
Eric F Crist
0fdd390c11
Check for dh.pem before overwriting
gen-dh would overwrite dh.pem without warning

In batch mode, easyrsa now exits 1 if dh.pem exists.

In interactive move, the user is prompted if dh.pem exists.

Fixes #373

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-04-14 19:36:14 -05:00
Eric F Crist
3e93f925d3
Add version output option and info
Now supports both --version and "version and outputs detailed version
information.  Tested on FreeBSD, macOS, and Windows 10 64-bit.

Sample Output:

EasyRSA Version Information
Version:     git-development
Generated:   Tue Apr 14 18:54:42 CDT 2020
SSL Lib:     OpenSSL 1.1.1a-freebsd  20 Nov 2018
Git Commit:  f0129cfe6222820a85db2d394ab73d3c7759c5be
Source Repo: https://github.com/OpenVPN/easy-rsa

This closes #372

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-04-14 19:10:07 -05:00
Sean McKay
04fe65de17 Enable Edwards Curves for Public Key Algorithm
When Edwards curves are currently specified, they will be used for the
signature algorithm, but the actual public/private keypair will fall
back to defaults (RSA2048), which is likely not what the user intends.

This commit modifies the code so that requesting Edwards curves will
result in their use for the Public Key Algorithm (new behavior) in
addition to the Signature Algorithm (current behavior)

Examples of fixed and current (broken) behavior given below. Note the
Public Key Algorithm in the middle of the certificate and the message
from openssl of the private key type that's being generated:

-----------------------------------------------------------------------
Fixed example:

easyrsa@ubuntu:~/easy-rsa/easyrsa3$ ./easyrsa --batch --req-cn=ed25519-fixed \
    gen-req ed25519-fixed nopass >/dev/null
Generating a ED25519 private key
writing new private key to
'/home/easyrsa/easy-rsa/easyrsa3/pki/easy-rsa-6978.eq66M2/tmp.fEv2Hd'
-----

easyrsa@ubuntu:~/easy-rsa/easyrsa3$ ./easyrsa --batch sign-req client \
    ed25519-fixed 2>/dev/null
Using SSL: openssl OpenSSL 1.1.1c  28 May 2019

easyrsa@ubuntu:~/easy-rsa/easyrsa3$ cat ./pki/issued/ed25519-fixed.crt
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            3c:34:a6:4c:f8:6b:a5:e9:d0:4d:87:4f:d5:a0:e8:df
        Signature Algorithm: ED25519
        Issuer: CN=Easy-RSA CA
        Validity
            Not Before: Apr  5 00:32:23 2020 GMT
            Not After : Jul  9 00:32:23 2022 GMT
        Subject: CN=ed25519-fixed
        Subject Public Key Info:
            Public Key Algorithm: ED25519
                ED25519 Public-Key:
                pub:
                    ac:12:08:26:f7:ba:21:97:b4:51:ff:02:64:a2:af:
                    09:3a:08:e3:a0:42:8c:4f:d2:e8:a2:52:df:ee:26:
                    c0:da
        X509v3 extensions:
            X509v3 Basic Constraints:
                CA:FALSE
            X509v3 Subject Key Identifier:
                4B:BD:7F:5E:A5:BD:3A:1B:4C:AB:60:D3:B7:78:80:96:DB:78:89:95
            X509v3 Authority Key Identifier:
                keyid:36:00:DF:FE:4A:31:5F:3B:F2:83:81:D9:E6:44:D7:ED:14:6B:67:90
                DirName:/CN=Easy-RSA CA
                serial:69:B7:DB:13:B1:D5:A3:E7:A5:AF:74:38:49:12:E3:DB:50:AD:0D:87

            X509v3 Extended Key Usage:
                TLS Web Client Authentication
            X509v3 Key Usage:
                Digital Signature
    Signature Algorithm: ED25519
         0d:7c:19:1c:92:dc:0a:8e:2f:4a:f7:c1:0b:02:a5:18:93:19:
         45:04:0f:6e:40:f2:c3:a9:bf:72:bc:66:c2:f4:ef:48:4e:72:
         e9:14:43:9c:22:c8:8e:70:f8:25:db:b6:f7:8a:8f:78:c0:a5:
         3e:40:77:3c:12:f5:5a:72:eb:0d
-----BEGIN CERTIFICATE-----
MIIBjzCCAUGgAwIBAgIQPDSmTPhrpenQTYdP1aDo3zAFBgMrZXAwFjEUMBIGA1UE
AwwLRWFzeS1SU0EgQ0EwHhcNMjAwNDA1MDAzMjIzWhcNMjIwNzA5MDAzMjIzWjAY
MRYwFAYDVQQDDA1lZDI1NTE5LWZpeGVkMCowBQYDK2VwAyEArBIIJve6IZe0Uf8C
ZKKvCToI46BCjE/S6KJS3+4mwNqjgaIwgZ8wCQYDVR0TBAIwADAdBgNVHQ4EFgQU
S71/XqW9OhtMq2DTt3iAltt4iZUwUQYDVR0jBEowSIAUNgDf/koxXzvyg4HZ5kTX
7RRrZ5ChGqQYMBYxFDASBgNVBAMMC0Vhc3ktUlNBIENBghRpt9sTsdWj56WvdDhJ
EuPbUK0NhzATBgNVHSUEDDAKBggrBgEFBQcDAjALBgNVHQ8EBAMCB4AwBQYDK2Vw
A0EADXwZHJLcCo4vSvfBCwKlGJMZRQQPbkDyw6m/crxmwvTvSE5y6RRDnCLIjnD4
Jdu294qPeMClPkB3PBL1WnLrDQ==
-----END CERTIFICATE-----

-----------------------------------------------------------------------
Current (broken) example:

easyrsa@ubuntu:~/easy-rsa/easyrsa3$ ./easyrsa --batch --req-cn=ed25519-broken \
    gen-req ed25519-broken nopass >/dev/null
Generating a RSA private key
..........................................................................+++++
......+++++
writing new private key to
'/home/easyrsa/easy-rsa/easyrsa3/pki/easy-rsa-6901.tfUGNM/tmp.IEPoPv'
-----

easyrsa@ubuntu:~/easy-rsa/easyrsa3$ ./easyrsa --batch sign-req client \
    ed25519-broken 2>/dev/null
Using SSL: openssl OpenSSL 1.1.1c  28 May 2019

easyrsa@ubuntu:~/easy-rsa/easyrsa3$ cat ./pki/issued/ed25519-broken.crt
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            8b:9c:25:ae:25:b0:b2:b1:ab:b0:34:b1:fc:75:70:f8
        Signature Algorithm: ED25519
        Issuer: CN=Easy-RSA CA
        Validity
            Not Before: Apr  5 00:27:09 2020 GMT
            Not After : Jul  9 00:27:09 2022 GMT
        Subject: CN=ed25519-broken
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
                RSA Public-Key: (2048 bit)
                Modulus:
                    00:cf:30:67:14:18:e8:bd:8b:89:23:ac:ac:a8:6c:
                    c4:6b:bd:50:cd:0d:d1:cf:b0:09:4a:8a:11:89:52:
                    7e:8e:01:78:d9:99:94:35:90:be:7e:0a:8b:20:c2:
                    ca:36:ef:3d:0e:17:8e:c9:83:66:42:a1:83:ed:3e:
                    ed:4d:04:4a:3f:fd:33:ba:6f:dc:cc:5c:c4:0b:1f:
                    3f:02:8a:d2:13:5b:e8:36:d4:88:10💿14:4a:41:
                    bd:b1:d1:f4:04:89:8f:a0:10:da:16:da:12:57:91:
                    06:81:c9🇩🇪2a:da:c2:1b:51:52:2e:a6:20:36:04:
                    2f:9a:6f:b5:05:6d:f8:ec:65:86:9a:85:d2:6e:44:
                    47:8a:76:bb:0b:96:34:57:db:b6:a3:b6:76:53:95:
                    a5:9d:08:9f:35:17:04:22:11:04:66:1e:aa:28:1d:
                    78:90:c5:9c:19:6b:5d:41:52:79:82:cb:0a:3a:12:
                    86:71:bc:61:19:c7:e3:42:94:8b:b5:69:47:ac:2c:
                    8f:18:13🇩🇪f4:52:6a:b5:ba:78:f0:65:5a:88:50:
                    0f:0f:46:ef:d9:8e:61:fe:33:5c:01:06:82:38:8b:
                    db:71:f3:7b:94:14:13:8f:94:25:a7:db:8c:53:85:
                    ea:6a:b2:89:fc:59:c6:61:10🆎ea:38:94:e2:1f:
                    0d:47
                Exponent: 65537 (0x10001)
        X509v3 extensions:
            X509v3 Basic Constraints:
                CA:FALSE
            X509v3 Subject Key Identifier:
                40:DF:D9:F3:85:F9:56:5B:E4:65:EC:5A:32:CE:0D:42:35:0F:89:7F
            X509v3 Authority Key Identifier:
                keyid:36:00:DF:FE:4A:31:5F:3B:F2:83:81:D9:E6:44:D7:ED:14:6B:67:90
                DirName:/CN=Easy-RSA CA
                serial:69:B7:DB:13:B1:D5:A3:E7:A5:AF:74:38:49:12:E3:DB:50:AD:0D:87

            X509v3 Extended Key Usage:
                TLS Web Client Authentication
            X509v3 Key Usage:
                Digital Signature
    Signature Algorithm: ED25519
         b3:61:98:2d:49:2f:f9:ce:79:a7:bb:dd:9c:31:41:12:e4:a5:
         72:a4:5b:2e:f0:ec:6a:56:26:4e:5c:f9:91:b9:5e:96:d0:c4:
         83:8c:81:49:18:df:10:0d:78:b9:82:86:22:f5:67:f9:1a:f5:
         3e:5a:19:15:66:38:2f:ce:3a:0e
-----BEGIN CERTIFICATE-----
MIICizCCAj2gAwIBAgIRAIucJa4lsLKxq7A0sfx1cPgwBQYDK2VwMBYxFDASBgNV
BAMMC0Vhc3ktUlNBIENBMB4XDTIwMDQwNTAwMjcwOVoXDTIyMDcwOTAwMjcwOVow
GTEXMBUGA1UEAwwOZWQyNTUxOS1icm9rZW4wggEiMA0GCSqGSIb3DQEBAQUAA4IB
DwAwggEKAoIBAQDPMGcUGOi9i4kjrKyobMRrvVDNDdHPsAlKihGJUn6OAXjZmZQ1
kL5+Cosgwso27z0OF47Jg2ZCoYPtPu1NBEo//TO6b9zMXMQLHz8CitITW+g21IgQ
zRRKQb2x0fQEiY+gENoW2hJXkQaByd4q2sIbUVIupiA2BC+ab7UFbfjsZYaahdJu
REeKdrsLljRX27ajtnZTlaWdCJ81FwQiEQRmHqooHXiQxZwZa11BUnmCywo6EoZx
vGEZx+NClIu1aUesLI8YE970Umq1unjwZVqIUA8PRu/ZjmH+M1wBBoI4i9tx83uU
FBOPlCWn24xThepqson8WcZhEKvqOJTiHw1HAgMBAAGjgaIwgZ8wCQYDVR0TBAIw
ADAdBgNVHQ4EFgQUQN/Z84X5VlvkZexaMs4NQjUPiX8wUQYDVR0jBEowSIAUNgDf
/koxXzvyg4HZ5kTX7RRrZ5ChGqQYMBYxFDASBgNVBAMMC0Vhc3ktUlNBIENBghRp
t9sTsdWj56WvdDhJEuPbUK0NhzATBgNVHSUEDDAKBggrBgEFBQcDAjALBgNVHQ8E
BAMCB4AwBQYDK2VwA0EAs2GYLUkv+c55p7vdnDFBEuSlcqRbLvDsalYmTlz5kble
ltDEg4yBSRjfEA14uYKGIvVn+Rr1PloZFWY4L846Dg==
-----END CERTIFICATE-----
2020-04-04 17:39:20 -07:00
Eric F Crist
f0129cfe62
Correct formatting issue in vars.example
Closes #370

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-03-31 09:01:07 -05:00
Eric F Crist
945c9359f6
Update changelog for release v3.0.7
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-03-30 18:51:33 -05:00
Eric F Crist
8af5466b7c
Add support for RID in SAN
Merge branch 'ccin2p3-feature/OID'

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-03-28 20:57:31 -05:00
Eric F Crist
667eb4e4b3
Merge branch 'feature/OID' of https://github.com/ccin2p3/easy-rsa 2020-03-28 20:57:12 -05:00
Eric F Crist
e7169b6d90
Update changelog for #362 - RID in SAN
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-03-28 20:55:25 -05:00
Eric F Crist
b543c7095d
Add support for RID (RegisteredID) to SAN
Merge branch 'feature/OID' of https://github.com/ccin2p3/easy-rsa into ccin2p3-feature/OID

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-03-28 20:51:28 -05:00
Eric F Crist
fc1ad59fbb
Update changelog to add note for passin/out env vars
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-03-28 20:46:00 -05:00
Eric F Crist
949931811f
Expose EASYRSA_PASSIN and EASYRSA_PASSOUT
Also adds a check to prevent it from being present in the config file.
This still needs a unit test long term.  Closes #365.

Merge branch 'pschiffe-master'

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-03-28 20:41:38 -05:00
Peter Schiffer
f390dbebc1
Check for EASYRSA_PASSIN and EASYRSA_PASSOUT vars in config file
and refuse to continue if they are present there, as they might containg
passwords.
2020-03-26 23:51:02 +01:00
Peter Schiffer
f4b4308f16
Expose EASYRSA_PASSIN and EASYRSA_PASSOUT env variables
By exposing these variables it's possible to configure the password from
various sources by specifing env vars. This is a followup to PR #242

Fixes #365
2020-03-26 23:09:28 +01:00
Eric F Crist
8f07331ab8
Update changelog
Adding support for Edwards Curves

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-03-24 18:10:08 -05:00
Eric F Crist
56fada79d0
Add support for Edwards Curves
Closes #354 and #350

Merge branch 'siddharths2710-master'

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-03-24 18:04:35 -05:00
Eric F Crist
2bca44ce61
Merge branch 'master' of https://github.com/siddharths2710/easy-rsa into siddharths2710-master 2020-03-24 18:04:17 -05:00
Sid Srinivas
7ef2302044 Provided support for ED curves 2020-03-17 07:59:46 +05:30
Eric F Crist
8c54f192e0
Changed link in README to use https
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-03-16 08:12:38 -05:00
Fᴀʙɪᴇɴ Wᴇʀɴʟɪ
72a9173df7 Add support for Object Identifier in Subject Alternative Names
See http://openssl.cs.utah.edu/docs/apps/x509v3_config.html:

> The subject alternative name extension allows various literal values
> to be included in the configuration file. These include email (an email
> address) URI a uniform resource indicator, DNS (a DNS domain name), RID
> (a registered ID: OBJECT IDENTIFIER), IP (an IP address), dirName (a
> distinguished name) and otherName.
2020-03-12 09:04:58 +01:00
Randolf Richardson
d4588cfd89
Update README.md
Changed link to POSIX standard from HTTP to HTTPS.
2020-03-02 21:47:24 -08:00
root
c45298e804 Bug fixes and code formatting for ed curves 2020-02-01 11:03:48 +01:00
root
2c72a7a231 Hardcoded checks for ED curves manually 2020-01-20 15:39:48 +01:00
root
48da132a89 Removed stray quotes 2020-01-19 08:16:26 +01:00
root
da6f658770 Removed stray ED echo 2020-01-19 08:08:09 +01:00
root
ce858f56c5 Added ED curve support 2020-01-19 07:54:24 +01:00
Eric F Crist
e59911a474
Add support for named pipe for ca.key
Closes #347

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-01-11 17:55:57 -06:00
Eric F Crist
5cbf4498aa
Merge branch 'master' of https://github.com/jvsalo/easy-rsa into jvsalo-master 2020-01-11 17:55:39 -06:00
Eric F Crist
ae7e293759
Generate a useful error if config doesn't exits
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-01-11 16:10:54 -06:00
Eric F Crist
5eec79de29
Merge branch 'master' of https://github.com/rolfchess/easy-rsa into rolfchess-master 2020-01-11 16:10:31 -06:00
Eric F Crist
1b3d0cb172
Update Changelog
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-01-11 16:10:22 -06:00
Eric F Crist
ad49dcff1f
Add support for KDC certificates
Closes #322

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-01-11 16:03:04 -06:00
Eric F Crist
c4942d9abe
Merge branch 'kdc' of https://github.com/xavierba/easy-rsa into xavierba-kdc 2020-01-11 16:02:24 -06:00
Eric F Crist
a52aab9638
Update docs, clarify some language.
Closes #310

Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-01-11 15:56:20 -06:00
Eric F Crist
597d6c0272
Merge branch 'docs' of https://github.com/oliv3r/easy-rsa into oliv3r-docs 2020-01-11 15:55:47 -06:00
Eric F Crist
b2bebf95b6
Update Changelog to mention upgrade script
Signed-off-by: Eric F Crist <ecrist@secure-computing.net>
2020-01-11 15:41:46 -06:00