Sha256: e4c0ed1fd9b65c974ba7a7477a5945f867b40001b95f7e7d4ce434443aba5b8f

Contents?: true

Size: 792 Bytes

Versions: 50

Compression:

Stored size: 792 Bytes

Contents

require File.dirname(__FILE__) + '/../test_helper.rb'

module CryptoProviderTest
  class Sha1Test < ActiveSupport::TestCase
    def test_encrypt
      assert Authlogic::CryptoProviders::Sha1.encrypt("mypass")
    end
    
    def test_matches
      hash = Authlogic::CryptoProviders::Sha1.encrypt("mypass")
      assert Authlogic::CryptoProviders::Sha1.matches?(hash, "mypass")
    end
    
    def test_old_restful_authentication_passwords
      password = "test"
      salt = "7e3041ebc2fc05a40c60028e2c4901a81035d3cd"
      digest = "00742970dc9e6319f8019fd54864d3ea740f04b1"
      Authlogic::CryptoProviders::Sha1.stretches = 1
      assert Authlogic::CryptoProviders::Sha1.matches?(digest, nil, salt, password, nil)
      Authlogic::CryptoProviders::Sha1.stretches = 10
    end
  end
end

Version data entries

50 entries across 50 versions & 15 rubygems

Version Path
authlogic-2.1.11 test/crypto_provider_test/sha1_test.rb
authlogic-2.1.10 test/crypto_provider_test/sha1_test.rb
binarylogic-authlogic-2.1.0 test/crypto_provider_test/sha1_test.rb
binarylogic-authlogic-2.1.1 test/crypto_provider_test/sha1_test.rb
crankharder-authlogic-2.1.1 test/crypto_provider_test/sha1_test.rb
jlecour-authlogic-2.1.2 test/crypto_provider_test/sha1_test.rb
kschrader-authlogic-2.1.2 test/crypto_provider_test/sha1_test.rb
kschrader-authlogic-2.1.3 test/crypto_provider_test/sha1_test.rb
authlogic-2.1.8 test/crypto_provider_test/sha1_test.rb
authlogic-2.1.7 test/crypto_provider_test/sha1_test.rb
expertiza-authlogic-2.1.6.1 test/crypto_provider_test/sha1_test.rb
wulffeld_authlogic-2.1.3 test/crypto_provider_test/sha1_test.rb
authlogic-2.1.6 test/crypto_provider_test/sha1_test.rb
lockbox_middleware-1.2.1 vendor/gems/authlogic-2.1.3/test/crypto_provider_test/sha1_test.rb
Empact-authlogic-2.1.5 test/crypto_provider_test/sha1_test.rb
authlogic-2.1.5 test/crypto_provider_test/sha1_test.rb
authlogic-2.1.4 test/crypto_provider_test/sha1_test.rb
Empact-authlogic-2.1.4 test/crypto_provider_test/sha1_test.rb
namxam-authlogic-2.1.3.1 test/crypto_provider_test/sha1_test.rb
drogus-authlogic-2.1.3 test/crypto_provider_test/sha1_test.rb