Sha256: 3ae68d5b9a5cdbcf8df40f80a799b59d4ba1b4bae749e1e5d9c88573b9aff93b

Contents?: true

Size: 760 Bytes

Versions: 27

Compression:

Stored size: 760 Bytes

Contents

require 'test_helper'

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

27 entries across 27 versions & 9 rubygems

Version Path
authlogic-3.4.6 test/crypto_provider_test/sha1_test.rb
authlogic-3.4.5 test/crypto_provider_test/sha1_test.rb
authlogic-3.4.4 test/crypto_provider_test/sha1_test.rb
authlogic-3.4.3 test/crypto_provider_test/sha1_test.rb
authlogic-3.4.2 test/crypto_provider_test/sha1_test.rb
authlogic-3.4.1 test/crypto_provider_test/sha1_test.rb
authlogic-3.4.0 test/crypto_provider_test/sha1_test.rb
authlogic-3.3.0 test/crypto_provider_test/sha1_test.rb
authlogic-3.2.0 test/crypto_provider_test/sha1_test.rb
authlogic-3.1.3 test/crypto_provider_test/sha1_test.rb
authlogic-3.1.2 test/crypto_provider_test/sha1_test.rb
authlogic-3.1.1 test/crypto_provider_test/sha1_test.rb
nulogy-authlogic-3.1.0.1 test/crypto_provider_test/sha1_test.rb
Empact-authlogic-3.1.0 test/crypto_provider_test/sha1_test.rb
authlogic-3.1.0 test/crypto_provider_test/sha1_test.rb
Empact-authlogic-3.0.3 test/crypto_provider_test/sha1_test.rb
antlypls-authlogic-3.0.3 test/crypto_provider_test/sha1_test.rb
authlogic-3.0.3 test/crypto_provider_test/sha1_test.rb
authlogic-3.0.2 test/crypto_provider_test/sha1_test.rb
authlogic-3.0.1 test/crypto_provider_test/sha1_test.rb