Esempio n. 1
0
        public bool Invalid_hash_cannot_be_verified(ISecureHashProvider provider)
        {
            var hash   = provider.Password(Encoding.UTF8.GetBytes(Password));
            var result = provider.PasswordVerify(Encoding.UTF8.GetBytes("rosebowl"), hash);

            return(result == VerifyHashResult.Invalid);
        }
Esempio n. 2
0
        public bool Hash_can_be_verified(ISecureHashProvider provider)
        {
            var hash   = provider.Password(Encoding.UTF8.GetBytes(Password));
            var result = provider.PasswordVerify(Encoding.UTF8.GetBytes(Password), hash);

            return(result == VerifyHashResult.Valid);
        }
Esempio n. 3
0
        public bool Same_input_produces_different_hash(ISecureHashProvider provider)
        {
            var bytes = Encoding.UTF8.GetBytes(Password);
            var left  = provider.Password(bytes);   // ARGON2 w/ built-in salt
            var right = provider.Password(bytes);

            return(!left.SequenceEqual(right));
        }
Esempio n. 4
0
        public bool Different_input_produces_different_hash(ISecureHashProvider provider)
        {
            var leftBytes  = Encoding.UTF8.GetBytes(Password);
            var rightBytes = Encoding.UTF8.GetBytes("rosebowl");

            var left  = provider.Password(leftBytes);
            var right = provider.Password(rightBytes);

            return(!left.SequenceEqual(right));
        }
Esempio n. 5
0
 public AuthenticationMessageHandler(ILogger <AuthenticationMessageHandler> logger,
                                     IAuthenticationSynchronizationContextService authenticationSynchronizationContextService,
                                     IUnitOfWorkFactory unitOfWorkFactory,
                                     ISecureHashProvider secureHashProvider,
                                     ICharacterEquipmentBuilder characterEquipmentBuilder)
 {
     _logger = logger;
     _authenticationSynchronizationContextService = authenticationSynchronizationContextService;
     _unitOfWorkFactory         = unitOfWorkFactory;
     _secureHashProvider        = secureHashProvider;
     _characterEquipmentBuilder = characterEquipmentBuilder;
 }
Esempio n. 6
0
 public PasswordHasher(ISecureHashProvider secureHashProvider)
 {
     _secureHashProvider = secureHashProvider;
 }
Esempio n. 7
0
 public LoginSeed(ISecureHashProvider secureHashProvider)
 {
     _secureHashProvider = secureHashProvider;
 }