diff options
Diffstat (limited to 'internal/storage')
| -rw-r--r-- | internal/storage/sql_provider.go | 4 | ||||
| -rw-r--r-- | internal/storage/sql_provider_backend_postgres.go | 2 | 
2 files changed, 3 insertions, 3 deletions
diff --git a/internal/storage/sql_provider.go b/internal/storage/sql_provider.go index 7154a404e..21c84cfe2 100644 --- a/internal/storage/sql_provider.go +++ b/internal/storage/sql_provider.go @@ -561,7 +561,7 @@ func (p *SQLProvider) LoadTOTPConfiguration(ctx context.Context, username string  // SaveTOTPHistory saves a TOTP history item in the storage provider.  func (p *SQLProvider) SaveTOTPHistory(ctx context.Context, username string, step uint64) (err error) { -	signature := p.otpHMACSignature([]byte(strconv.Itoa(int(step))), []byte(username)) +	signature := p.otpHMACSignature([]byte(strconv.FormatUint(step, 10)), []byte(username))  	if _, err = p.db.ExecContext(ctx, p.sqlInsertTOTPHistory, username, signature); err != nil {  		return fmt.Errorf("error inserting TOTP history for user '%s': %w", username, err) @@ -574,7 +574,7 @@ func (p *SQLProvider) SaveTOTPHistory(ctx context.Context, username string, step  func (p *SQLProvider) ExistsTOTPHistory(ctx context.Context, username string, step uint64) (exists bool, err error) {  	var count int -	signature := p.otpHMACSignature([]byte(strconv.Itoa(int(step))), []byte(username)) +	signature := p.otpHMACSignature([]byte(strconv.FormatUint(step, 10)), []byte(username))  	if err = p.db.GetContext(ctx, &count, p.sqlSelectTOTPHistory, username, signature); err != nil {  		return false, fmt.Errorf("error checking if TOTP history exists: %w", err) diff --git a/internal/storage/sql_provider_backend_postgres.go b/internal/storage/sql_provider_backend_postgres.go index ee6aa434b..41dd83db0 100644 --- a/internal/storage/sql_provider_backend_postgres.go +++ b/internal/storage/sql_provider_backend_postgres.go @@ -154,7 +154,7 @@ func dsnPostgreSQL(config *schema.StoragePostgreSQL, globalCACertPool *x509.Cert  	dsnConfig, _ := pgx.ParseConfig("")  	dsnConfig.Host = config.Address.SocketHostname() -	dsnConfig.Port = uint16(config.Address.Port()) +	dsnConfig.Port = config.Address.Port()  	dsnConfig.Database = config.Database  	dsnConfig.User = config.Username  	dsnConfig.Password = config.Password  | 
