File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -94,17 +94,17 @@ def insync?(is)
9494 when %r{^\{ MD5\} .+}
9595 "{MD5}#{ Digest ::MD5 . hexdigest ( should ) } " == is
9696 when %r{^\{ SMD5\} .+}
97- salt = is [ 16 ..- 1 ]
97+ salt = is [ 16 ..]
9898 md5_hash_with_salt = "#{ Digest ::MD5 . digest ( should + salt ) } #{ salt } "
9999 is == "{SMD5}#{ [ md5_hash_with_salt ] . pack ( 'm' ) . delete ( "\n " ) } "
100100 when %r{^\{ SSHA\} .+}
101101 decoded = Base64 . decode64 ( is . gsub ( %r{^\{ SSHA\} } , '' ) )
102- salt = decoded [ 20 ..- 1 ]
102+ salt = decoded [ 20 ..]
103103 "{SSHA}#{ Base64 . encode64 ( "#{ Digest ::SHA1 . digest ( "#{ should } #{ salt } " ) } #{ salt } " ) . chomp } " == is
104104 when %r{^\{ SHA\} .+}
105105 "{SHA}#{ Digest ::SHA1 . hexdigest ( should ) } " == is
106106 when %r{^\{ (SHA(256|384|512))\} }
107- matches = is . match ( "^ \ { (SHA[\\ d]{,3})\} " )
107+ matches = is . match ( '^ {(SHA[\\d]{,3})}' )
108108 raise ArgumentError , "Invalid password format: #{ is } " if matches . nil?
109109
110110 crypto = matches [ 1 ]
Original file line number Diff line number Diff line change 44
55# rubocop:disable RSpec/DescribeSymbol
66describe :openldap_password do
7- it { is_expected . not_to eq ( nil ) }
7+ it { is_expected . not_to be_nil }
88
99 it 'fails with wrong number of arguments' do
1010 is_expected . to run . with_params . and_raise_error ( StandardError )
You can’t perform that action at this time.
0 commit comments