Sha256: 9a85474e0e76e64b0ee0420be7895f08fa823e11837083885c9a4774bdff2652

Contents?: true

Size: 793 Bytes

Versions: 10

Compression:

Stored size: 793 Bytes

Contents

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

module CryptoProviderTests
  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

10 entries across 10 versions & 1 rubygems

Version Path
authlogic-1.3.8 test/crypto_provider_tests/sha1_test.rb
authlogic-1.3.4 test/crypto_provider_tests/sha1_test.rb
authlogic-1.3.9 test/crypto_provider_tests/sha1_test.rb
authlogic-1.4.0 test/crypto_provider_tests/sha1_test.rb
authlogic-1.4.1 test/crypto_provider_tests/sha1_test.rb
authlogic-1.3.7 test/crypto_provider_tests/sha1_test.rb
authlogic-1.3.5 test/crypto_provider_tests/sha1_test.rb
authlogic-1.3.6 test/crypto_provider_tests/sha1_test.rb
authlogic-1.4.3 test/crypto_provider_tests/sha1_test.rb
authlogic-1.4.2 test/crypto_provider_tests/sha1_test.rb