mkpasswd 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/mkpasswd/version.rb +1 -1
- data/lib/mkpasswd.rb +8 -2
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f0adf4e38727d5d57c224148748c4c690dbc09d76691c735c660613f66ea4b6f
|
4
|
+
data.tar.gz: c46146cca3b74716107bbf0c55e1adcbbb1aa9867a62c11543c68401aceb5639
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2bd9c69ac88535a81567d81b41a657d7cbddb4c1a4f14fafeaa86841e0bcdaaf837f276e68190002d664aca8b4442ccc7f0db1642b8eb962f0459ad62695ec8
|
7
|
+
data.tar.gz: d9a558ba7694086c6b044049cbaf71849d3910a88e6388f6f130d65d82d6cd61e62087864d245d76b5b77554db9163ad52d59e284109ce657a787d451c3bde8d
|
data/lib/mkpasswd/version.rb
CHANGED
data/lib/mkpasswd.rb
CHANGED
@@ -20,7 +20,7 @@ class Mkpasswd
|
|
20
20
|
|
21
21
|
def initialize(args)
|
22
22
|
self.options = OpenStruct.new
|
23
|
-
options.hashmethod = '
|
23
|
+
options.hashmethod = 'sha-512'
|
24
24
|
options.hasher = HASHERS[options.hashmethod]
|
25
25
|
|
26
26
|
OptionParser.new do |opts|
|
@@ -35,7 +35,7 @@ class Mkpasswd
|
|
35
35
|
puts HASHERS.keys
|
36
36
|
exit
|
37
37
|
end
|
38
|
-
options.hashmethod = hasher.to_s
|
38
|
+
options.hashmethod = hasher.to_s.downcase
|
39
39
|
options.hasher = HASHERS[options.hashmethod]
|
40
40
|
raise 'Invalid hash algorithm for -m/--method' if options.hasher.nil?
|
41
41
|
end
|
@@ -45,6 +45,10 @@ class Mkpasswd
|
|
45
45
|
options.salt = salt
|
46
46
|
end
|
47
47
|
|
48
|
+
opts.on('-s', 'Read input from stdin') do
|
49
|
+
options.read_from_stdin = true
|
50
|
+
end
|
51
|
+
|
48
52
|
opts.on('-R', '--rounds [ROUNDS]', Integer, 'Set number of hashing rounds (SHA256/SHA512 only)') do |rounds|
|
49
53
|
raise 'Invalid hashing rounds for -R/--rounds' if rounds.nil? || rounds.to_i <= 0
|
50
54
|
options.rounds = rounds
|
@@ -64,6 +68,8 @@ class Mkpasswd
|
|
64
68
|
options.password = ARGV.shift
|
65
69
|
if options.password
|
66
70
|
$0 = $0 # this invocation will get rid of the command line arguments from the process list
|
71
|
+
elsif options.read_from_stdin
|
72
|
+
options.password = $stdin.read.chomp
|
67
73
|
else
|
68
74
|
options.password = ask_password
|
69
75
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mkpasswd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Novikov
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unix-crypt
|
@@ -80,7 +80,7 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
description:
|
83
|
+
description:
|
84
84
|
email:
|
85
85
|
- envek@envek.name
|
86
86
|
executables:
|
@@ -106,7 +106,7 @@ homepage: https://github.com/Envek/mkpasswd
|
|
106
106
|
licenses:
|
107
107
|
- MIT
|
108
108
|
metadata: {}
|
109
|
-
post_install_message:
|
109
|
+
post_install_message:
|
110
110
|
rdoc_options: []
|
111
111
|
require_paths:
|
112
112
|
- lib
|
@@ -121,9 +121,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: '0'
|
123
123
|
requirements: []
|
124
|
-
|
125
|
-
|
126
|
-
signing_key:
|
124
|
+
rubygems_version: 3.3.3
|
125
|
+
signing_key:
|
127
126
|
specification_version: 4
|
128
127
|
summary: Command to generate password hashes, compatible by options with command from
|
129
128
|
GNU/Linux whois package.
|