Sha256: 425069689d4e156ab04dc22221a0aa83a47991fec583e20e4bc6650aa74a1101

Contents?: true

Size: 753 Bytes

Versions: 7

Compression:

Stored size: 753 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

7 entries across 7 versions & 1 rubygems

Version Path
authlogic-4.0.1 test/crypto_provider_test/sha1_test.rb
authlogic-4.0.0 test/crypto_provider_test/sha1_test.rb
authlogic-3.8.0 test/crypto_provider_test/sha1_test.rb
authlogic-3.7.0 test/crypto_provider_test/sha1_test.rb
authlogic-3.6.1 test/crypto_provider_test/sha1_test.rb
authlogic-3.6.0 test/crypto_provider_test/sha1_test.rb
authlogic-3.5.0 test/crypto_provider_test/sha1_test.rb