ovpn-key 0.8.5 → 0.8.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7416051f932e40fb29c714599ad2ae7090b33dd0cf90ac31d3186993adc5a29a
4
- data.tar.gz: 85b35e1706fd1ea6892363cb01caf734b7c6bf84614aac5a31d3d31c1f10bf8d
3
+ metadata.gz: 5c06246edcf8df830880f4ad8f5f6765339b2a39a697686c4a36245b6becbd87
4
+ data.tar.gz: 900eb66c44058003bdc1f2d4fea39697746ad2fbe90aa0733c8238d16df89b68
5
5
  SHA512:
6
- metadata.gz: 4c6baffe4fe1c9340cc4a2cff365eb82ea5a63aa4e943ea4aecd3bb629459558363f6fcd4621b97f287427a91f05562689ab4451915bf84b2dfde192970a6d1e
7
- data.tar.gz: 4759d340ff8f701aa5f1ea2e084070dd55a9511ddd9ee0583feb6d1c51a62187661207022a6e401010f89c9435dff71df767e34bbfef5c0c42f03aec1a67e2e7
6
+ metadata.gz: 607406e6afb34f21d0cea38cb6ade88e05da6ac8225090f52955804b66248bbb30644d2a5eabb2b1c5143367c23831363ab1fde304ffdc3f283aba4c49202c90
7
+ data.tar.gz: b39664b3431c3c034df5fe067eb186efe0ecd77707a3f4e6929f94972f5750426f4736c68c14ab668f00768d65caea014c75087e9ba8b724b5d3a122fa9863ef
data/bin/ovpn-key CHANGED
@@ -178,7 +178,7 @@ if options[:generate_zip]
178
178
  gen_and_sign('client', options[:generate_zip], options[:no_password] ? nil : ask_password(options[:generate_zip]))
179
179
 
180
180
  zip_file = File.join(File.expand_path(ZIP_DIR), "#{File.basename ovpn_file, '.ovpn'}.tblk.zip")
181
- File.delete(zip_file) if File.exist?(zip_file)
181
+ FileUtils.rm_f(zip_file)
182
182
  Zip::File.open(zip_file, Zip::File::CREATE) do |zip|
183
183
  zip.get_output_stream(ovpn_file) {|f|
184
184
  f.write File.read(ovpn_file)
data/lib/functions.rb CHANGED
@@ -44,9 +44,8 @@ end
44
44
 
45
45
  def gen_key(certname, password)
46
46
  key = OpenSSL::PKey::RSA.new(KEY_SIZE)
47
- File.open("#{certname}.key", 'w') do |f|
48
- f.write password ? key.to_pem(OpenSSL::Cipher.new(ENCRYPT), password) : key
49
- end
47
+ File.write("#{certname}.key",
48
+ password ? key.to_pem(OpenSSL::Cipher.new(ENCRYPT), password) : key)
50
49
  end
51
50
 
52
51
  # type is one of: 'ca', 'server', 'client'
@@ -59,8 +58,8 @@ def sign_key(type, cn, password)
59
58
  ca_key = type == 'ca' ? key : unencrypt_ca_key
60
59
  cert.sign ca_key, OpenSSL::Digest.new(DIGEST)
61
60
 
62
- File.open(SERIAL_FILE, 'w') {|f| f.write serial }
63
- File.open("#{certname}.crt", 'w') {|f| f.write cert.to_pem }
61
+ File.write(SERIAL_FILE, serial)
62
+ File.write("#{certname}.crt", cert.to_pem)
64
63
  end
65
64
 
66
65
  def gen_cert(type, cn, pubkey, serial)
@@ -84,7 +83,7 @@ def basic_cert(type, cn)
84
83
  end
85
84
 
86
85
  def time_after_days(days)
87
- Time.now + days * 86_400 # days to seconds
86
+ Time.now + (days * 86_400) # days to seconds
88
87
  end
89
88
 
90
89
  # rubocop:disable Metrics/MethodLength
@@ -141,7 +140,7 @@ def update_crl(crl, ca_pass)
141
140
  crl.last_update = Time.now
142
141
  crl.next_update = time_after_days(EXPIRE['crl'])
143
142
  crl.sign(ca_key, OpenSSL::Digest.new(DIGEST))
144
- File.open(CRL_FILE, 'w') {|f| f.write crl.to_pem }
143
+ File.write(CRL_FILE, crl.to_pem)
145
144
  end
146
145
 
147
146
  def new_serial
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- ::VERSION = '0.8.5'
3
+ VERSION = '0.8.6'
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ovpn-key
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.5
4
+ version: 0.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vasily Korytov
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2021-03-10 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rubyzip
@@ -41,8 +40,8 @@ files:
41
40
  homepage: https://github.com/chillum/ovpn-key
42
41
  licenses:
43
42
  - Apache-2.0
44
- metadata: {}
45
- post_install_message:
43
+ metadata:
44
+ rubygems_mfa_required: 'true'
46
45
  rdoc_options: []
47
46
  require_paths:
48
47
  - lib
@@ -57,8 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
57
56
  - !ruby/object:Gem::Version
58
57
  version: '0'
59
58
  requirements: []
60
- rubygems_version: 3.2.3
61
- signing_key:
59
+ rubygems_version: 4.0.2
62
60
  specification_version: 4
63
61
  summary: Key management utility for OpenVPN
64
62
  test_files: []