ovpn-key 0.7.3 → 0.7.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f3c5c58642f5c151172f602aa1b0182ecf8f45239b5de9c03aca65e9923e2b15
4
- data.tar.gz: b19dbc262c6a83c41f01152b90583afb09a9823a3b4689938ba455429ecba4b8
3
+ metadata.gz: 315b12aaa3f38b10e0c6d190f56eb6715efeb8b702c6427eb10ee51c6fd56246
4
+ data.tar.gz: 14586944d2f1b9b388198e6e05c8bc2347fe706c7aa065539e61bbc0588c3bd5
5
5
  SHA512:
6
- metadata.gz: a4f9f7bad183e3b5360dfc4e1d70320a7fcaa2ed2590060cf6f86049a1a3789308a4036d6dae2d10feaf304df657677cb42019cbd8efcfc376575680066c1a12
7
- data.tar.gz: 3b03ffa591731f274e90ed97be56fcce4c1a196c2384f8347f52d2c13e554754d2533b653d485656aa79b00cad1c2fa950c9b96f79a9c7fdbc2429b17d375006
6
+ metadata.gz: bde20521e7bcce945590fb9d04cba55e71b64ffab36c950341dd94f0b36cbd366d5e8437fa7fb2716ea4f1724331a829be36336c558d7b5dc5d076d9463278fb
7
+ data.tar.gz: 15197a504f944248d85e865e0262c1c4283c2c56a9d683f22a9411e2185570c4f05b260278b43323d6b6676851619ec619040be21b7777d079b6801923959c3d
data/README.md CHANGED
@@ -32,10 +32,10 @@ If you're brave, [let me know](https://github.com/chillum/ovpn-key/issues), wher
32
32
  3. `ovpn-key --ca --dh --server --nopass`
33
33
  4. `ovpn-key --client somebody [--nopass]`
34
34
  5. `ovpn-key --revoke somebody`
35
- 6. add a file with `.ovpn` extension to the directory
35
+ 6. `ovpn-key --static` (generates `ta.key`)
36
+ 7. add a file with `.ovpn` extension to the directory
36
37
  it should contain every setting except for `cert` and `key`
37
- 7. `ovpn-key --zip somebody-else [--nopass]`
38
- 8. `ovpn-key --static` (generates `ta.key`)
38
+ 8. `ovpn-key --zip somebody-else [--nopass]`
39
39
 
40
40
  ### Configuration
41
41
 
data/bin/ovpn-key CHANGED
@@ -91,11 +91,12 @@ OPENVPN = settings['openvpn'] || 'openvpn'
91
91
  OPENSSL = settings['openssl'] || 'openssl'
92
92
  KEY_SIZE = settings['key_size'] || 2048
93
93
  ENCRYPT = settings['encrypt'] || 'aes128'
94
+ CA_DAYS = settings['ca_days'] || 3650
94
95
  CN_CA = settings['ca_name'] || 'Certification Authority'
95
96
  REQ = settings['details']
96
97
 
97
98
  if options[:generate_ca]
98
- gen_key('ca', 'ca', options[:no_password])
99
+ gen_key('ca', options[:no_password])
99
100
  sign_key('ca', 'ca', CN_CA)
100
101
  gen_crl
101
102
  end
data/defaults/openssl.ini CHANGED
@@ -1,7 +1,6 @@
1
1
  [req]
2
2
  default_md = sha256
3
3
  distinguished_name = dn.ovpn
4
- days = 3650
5
4
 
6
5
  [dn.ovpn]
7
6
  CN = Certificate name (required)
@@ -3,5 +3,6 @@ openvpn: openvpn
3
3
  openssl: openssl
4
4
  key_size: 2048
5
5
  encrypt: aes128
6
+ ca_days: 3650
6
7
  ca_name: Certification Authority
7
8
  details: /C=US/ST=CA/L=San Francisco/O=Dva Debila/OU=OpenVPN
data/lib/functions.rb CHANGED
@@ -14,11 +14,11 @@ def exe cmd
14
14
  end
15
15
 
16
16
  def gen_and_sign type, certname, no_password
17
- gen_key(type, certname, no_password)
17
+ gen_key(certname, no_password)
18
18
  sign_key(type, certname, certname)
19
19
  end
20
20
 
21
- def gen_key type, certname, no_password
21
+ def gen_key certname, no_password
22
22
  if no_password
23
23
  exe "#{OPENSSL} genrsa -out '#{certname}.key' #{KEY_SIZE}"
24
24
  else
@@ -28,7 +28,7 @@ end
28
28
 
29
29
  def sign_key type, certname, cn
30
30
  if certname == 'ca'
31
- exe "#{OPENSSL} req -new -x509 -key '#{certname}.key' -out '#{certname}.crt' -config #{SSL_CONF} -subj '/CN=#{cn}#{REQ}' -extensions ext.#{type}"
31
+ exe "#{OPENSSL} req -new -x509 -key '#{certname}.key' -out '#{certname}.crt' -config #{SSL_CONF} -subj '/CN=#{cn}#{REQ}' -extensions ext.#{type} -days #{CA_DAYS}"
32
32
  else
33
33
  exe "#{OPENSSL} req -new -key '#{certname}.key' -out '#{certname}.csr' -config #{SSL_CONF} -subj '/CN=#{cn}#{REQ}' -extensions ext.#{type}"
34
34
  exe "#{OPENSSL} ca -in '#{certname}.csr' -out '#{certname}.crt' -config #{SSL_CONF} -extensions ext.#{type} -batch"
data/lib/version.rb CHANGED
@@ -1 +1 @@
1
- ::Version = '0.7.3'
1
+ ::Version = '0.7.4'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ovpn-key
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vasily Korytov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-03 00:00:00.000000000 Z
11
+ date: 2018-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip