ovpn-key 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +8 -14
- data/bin/ovpn-key +1 -1
- data/defaults/ovpn-key.yml +1 -1
- data/lib/functions.rb +7 -3
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d515fee311a6e6b14bf198a846cb815c3db731d86470376f1a86e63e623af283
|
|
4
|
+
data.tar.gz: c47751c735bf76b63fefad045156619f8ce12f6481fc2dab10879cfff8d0db83
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bd97b1f2c774d19a798cc95f85dc3db594642ddd4ef4a6eade66e778e3afa90a6104ec2b624ead4d2726fa62b1fabe965d1b6aa079f98c40fd34109031c33d45
|
|
7
|
+
data.tar.gz: b26e0ad49688ae7b059c2cdacabd7a398b9f08cb84dda0bfb78127c50f803123991972c081201e41a8cfaa4a9c38f3e03b822ab882752b9e9852f8ca3c1236a6
|
data/README.md
CHANGED
|
@@ -100,23 +100,11 @@ key_type: secp521r1
|
|
|
100
100
|
digest: SHA512
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
-
#### NIST P-256, the fastest
|
|
104
|
-
```yaml
|
|
105
|
-
key_type: secp256r1
|
|
106
|
-
digest: SHA256
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
#### ed25519, least compatible
|
|
110
|
-
```yaml
|
|
111
|
-
key_type: ed25519
|
|
112
|
-
#digest: not used
|
|
113
|
-
```
|
|
114
|
-
|
|
115
103
|
#### RSA 3K, a compromise if you still require RSA
|
|
116
104
|
```yaml
|
|
117
105
|
#key_type: # commented out
|
|
118
106
|
key_size: 3072
|
|
119
|
-
digest:
|
|
107
|
+
digest: SHA384
|
|
120
108
|
```
|
|
121
109
|
|
|
122
110
|
#### RSA 4K, the slowest
|
|
@@ -126,9 +114,15 @@ key_size: 4096
|
|
|
126
114
|
digest: SHA384
|
|
127
115
|
```
|
|
128
116
|
|
|
129
|
-
|
|
117
|
+
### Configurations to avoid
|
|
118
|
+
|
|
119
|
+
1. You might have an old configuration that still uses the `2K RSA`, this will work, but we recommend to phase out those deployments,
|
|
130
120
|
as they're currently under NIST baseline.
|
|
131
121
|
|
|
122
|
+
2. `ed25519` and `secp256r1` can be used as a `key_type`, but also not recommended (don't satisfy CNSA 1.0 baseline).
|
|
123
|
+
|
|
124
|
+
3. `SHA256` and `AES128` are under CNSA 1.0 baseline, so also not adviced.
|
|
125
|
+
|
|
132
126
|
### Mixed mode
|
|
133
127
|
|
|
134
128
|
You can start your CA as RSA and generate newer keys in ECC.
|
data/bin/ovpn-key
CHANGED
|
@@ -180,7 +180,7 @@ if options[:generate_ca]
|
|
|
180
180
|
end
|
|
181
181
|
if options[:generate_dh]
|
|
182
182
|
File.open('dh.pem', 'w') do |f|
|
|
183
|
-
|
|
183
|
+
$stderr.print 'Generating dh.pem. This will take a while'
|
|
184
184
|
f.write OpenSSL::PKey::DH.new(KEY_SIZE)
|
|
185
185
|
warn '. Done'
|
|
186
186
|
end
|
data/defaults/ovpn-key.yml
CHANGED
|
@@ -2,7 +2,7 @@ openvpn: openvpn # openvpn executable, required only for --static
|
|
|
2
2
|
zip_dir: '~' # directory for files generated by --zip
|
|
3
3
|
|
|
4
4
|
encrypt: AES256
|
|
5
|
-
digest: SHA384
|
|
5
|
+
digest: SHA384
|
|
6
6
|
key_type: secp384r1 # comment this out if you want to use RSA keys
|
|
7
7
|
key_size: 3072 # RSA and DH keys only
|
|
8
8
|
|
data/lib/functions.rb
CHANGED
|
@@ -99,13 +99,17 @@ def customize_cert(type, cert)
|
|
|
99
99
|
|
|
100
100
|
cert.add_extension ef.create_extension('subjectKeyIdentifier', 'hash')
|
|
101
101
|
cert.add_extension ef.create_extension('authorityKeyIdentifier', 'keyid,issuer:always')
|
|
102
|
-
cert.add_extension ef.create_extension('basicConstraints', type == 'ca' ? 'CA:true' : 'CA:false')
|
|
102
|
+
cert.add_extension ef.create_extension('basicConstraints', type == 'ca' ? 'critical,CA:true' : 'CA:false')
|
|
103
103
|
|
|
104
104
|
case type
|
|
105
105
|
when 'ca'
|
|
106
106
|
cert.add_extension ef.create_extension('keyUsage', 'cRLSign,keyCertSign')
|
|
107
107
|
when 'server'
|
|
108
|
-
cert.add_extension ef.create_extension('keyUsage',
|
|
108
|
+
cert.add_extension ef.create_extension('keyUsage', if KEY_TYPE
|
|
109
|
+
'digitalSignature'
|
|
110
|
+
else
|
|
111
|
+
'keyEncipherment,digitalSignature'
|
|
112
|
+
end)
|
|
109
113
|
cert.add_extension ef.create_extension('extendedKeyUsage', 'serverAuth')
|
|
110
114
|
when 'client'
|
|
111
115
|
cert.add_extension ef.create_extension('keyUsage', 'digitalSignature')
|
|
@@ -153,7 +157,7 @@ end
|
|
|
153
157
|
def new_serial
|
|
154
158
|
File.read(SERIAL_FILE).to_i + 1
|
|
155
159
|
rescue Errno::ENOENT
|
|
156
|
-
|
|
160
|
+
1
|
|
157
161
|
end
|
|
158
162
|
|
|
159
163
|
def create_dir(name)
|
data/lib/version.rb
CHANGED