ovpn-key 1.1.1 → 1.1.3
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 +7 -1
- data/bin/ovpn-key +1 -1
- data/lib/functions.rb +12 -4
- 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: '029bea57b6acb1762d94c9c87d5c03983bf4da6b52cff67f5fbdcc965dfd27a0'
|
|
4
|
+
data.tar.gz: b8464f78442918e7df3ab32510e51d75acb0aa18076a2bf58cc9cce2d8d7824c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bd946dd12497109fbef9de13ea480c194d14c4fcc84066a9b5115d5eb9eac1f6f49cab18b4dccbb117305d13c21d5058c6b3dbfffde2c61a0fed5b158b208448
|
|
7
|
+
data.tar.gz: 61d2dfb09af2f3f8a6d71b5144634e959367fe392227bd4053121e17c856740b3ceba1d3fa93eec718b943f5da4a314643aa905cf8c8f7d65e7d38c6d93ec866
|
data/README.md
CHANGED
|
@@ -114,6 +114,12 @@ key_size: 4096
|
|
|
114
114
|
digest: SHA384
|
|
115
115
|
```
|
|
116
116
|
|
|
117
|
+
#### ML-DSA-87, post-quantum safe
|
|
118
|
+
```yaml
|
|
119
|
+
key_type: ML-DSA-87
|
|
120
|
+
#digest: not used
|
|
121
|
+
```
|
|
122
|
+
|
|
117
123
|
### Configurations to avoid
|
|
118
124
|
|
|
119
125
|
1. You might have an old configuration that still uses the `2K RSA`, this will work, but we recommend to phase out those deployments,
|
|
@@ -121,7 +127,7 @@ as they're currently under NIST baseline.
|
|
|
121
127
|
|
|
122
128
|
2. `ed25519` and `secp256r1` can be used as a `key_type`, but also not recommended (don't satisfy CNSA 1.0 baseline).
|
|
123
129
|
|
|
124
|
-
3. `SHA256`
|
|
130
|
+
3. `SHA256` and `AES128` are under CNSA 1.0 baseline, so also not adviced.
|
|
125
131
|
|
|
126
132
|
### Mixed mode
|
|
127
133
|
|
data/bin/ovpn-key
CHANGED
|
@@ -122,7 +122,7 @@ CN_CA = settings['ca_name'] || 'Certification Authority'
|
|
|
122
122
|
ENCRYPT = settings['encrypt'] || 'AES256'
|
|
123
123
|
KEY_SIZE = settings['key_size'] || 3072
|
|
124
124
|
KEY_TYPE = settings['key_type'] # if that's not set, we assume a legacy install with RSA
|
|
125
|
-
DIGEST = unless
|
|
125
|
+
DIGEST = unless internal_digest?
|
|
126
126
|
settings['digest'] || 'SHA384'
|
|
127
127
|
end
|
|
128
128
|
|
data/lib/functions.rb
CHANGED
|
@@ -43,7 +43,7 @@ def gen_and_sign(type, certname, password)
|
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
def gen_key(certname, password)
|
|
46
|
-
key = if
|
|
46
|
+
key = if internal_digest?
|
|
47
47
|
OpenSSL::PKey.generate_key(KEY_TYPE)
|
|
48
48
|
elsif KEY_TYPE
|
|
49
49
|
OpenSSL::PKey::EC.generate(KEY_TYPE)
|
|
@@ -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)
|
|
@@ -162,3 +166,7 @@ def create_dir(name)
|
|
|
162
166
|
FileUtils.mkdir_p name
|
|
163
167
|
warn "Created directory: #{name}"
|
|
164
168
|
end
|
|
169
|
+
|
|
170
|
+
def internal_digest?
|
|
171
|
+
KEY_TYPE&.casecmp?('ed25519') || KEY_TYPE&.casecmp?('ml-dsa-87')
|
|
172
|
+
end
|
data/lib/version.rb
CHANGED