From 7ffb2c1d81ad195093b1b6b7cd611264cbd408b3 Mon Sep 17 00:00:00 2001 From: Roman Isaev Date: Sun, 5 Jan 2025 02:22:56 +0000 Subject: [PATCH] mas: minor fixes in cross_signing_keys_table files --- userapi/storage/postgres/cross_signing_keys_table.go | 6 +++--- userapi/storage/sqlite3/cross_signing_keys_table.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/userapi/storage/postgres/cross_signing_keys_table.go b/userapi/storage/postgres/cross_signing_keys_table.go index 7e66a011..66ccc9a3 100644 --- a/userapi/storage/postgres/cross_signing_keys_table.go +++ b/userapi/storage/postgres/cross_signing_keys_table.go @@ -45,8 +45,8 @@ const upsertCrossSigningKeysForUserSQL = "" + const updateMasterCrossSigningKeyAllowReplacementWithoutUiaSQL = "" + "UPDATE keyserver_cross_signing_keys" + - " SET updatable_without_uia_before_ms = $3" + - " WHERE user_id = $1 AND key_type = $2" + " SET updatable_without_uia_before_ms = $1" + + " WHERE user_id = $2 AND key_type = $3" type crossSigningKeysStatements struct { db *sql.DB @@ -150,7 +150,7 @@ func (s *crossSigningKeysStatements) UpsertCrossSigningKeysForUser( func (s *crossSigningKeysStatements) UpdateMasterCrossSigningKeyAllowReplacementWithoutUIA(ctx context.Context, txn *sql.Tx, userID string, duration time.Duration) (int64, error) { keyTypeInt, _ := types.KeyTypePurposeToInt[fclient.CrossSigningKeyPurposeMaster] ts := time.Now().Add(duration).UnixMilli() - result, err := sqlutil.TxStmt(txn, s.updateMasterCrossSigningKeyAllowReplacementWithoutUiaStmt).ExecContext(ctx, userID, keyTypeInt, ts) + result, err := sqlutil.TxStmt(txn, s.updateMasterCrossSigningKeyAllowReplacementWithoutUiaStmt).ExecContext(ctx, ts, userID, keyTypeInt) if err != nil { return -1, err } diff --git a/userapi/storage/sqlite3/cross_signing_keys_table.go b/userapi/storage/sqlite3/cross_signing_keys_table.go index 47a39f6b..c86cf206 100644 --- a/userapi/storage/sqlite3/cross_signing_keys_table.go +++ b/userapi/storage/sqlite3/cross_signing_keys_table.go @@ -44,8 +44,8 @@ const upsertCrossSigningKeysForUserSQL = "" + const updateMasterCrossSigningKeyAllowReplacementWithoutUiaSQL = "" + "UPDATE keyserver_cross_signing_keys" + - " SET updatable_without_uia_before_ms = $3" + - " WHERE user_id = $1 AND key_type = $2" + " SET updatable_without_uia_before_ms = $1" + + " WHERE user_id = $2 AND key_type = $3" type crossSigningKeysStatements struct { db *sql.DB @@ -149,7 +149,7 @@ func (s *crossSigningKeysStatements) UpsertCrossSigningKeysForUser( func (s *crossSigningKeysStatements) UpdateMasterCrossSigningKeyAllowReplacementWithoutUIA(ctx context.Context, txn *sql.Tx, userID string, duration time.Duration) (int64, error) { keyTypeInt, _ := types.KeyTypePurposeToInt[fclient.CrossSigningKeyPurposeMaster] ts := time.Now().Add(duration).UnixMilli() - result, err := sqlutil.TxStmt(txn, s.updateMasterCrossSigningKeyAllowReplacementWithoutUiaStmt).ExecContext(ctx, userID, keyTypeInt, ts) + result, err := sqlutil.TxStmt(txn, s.updateMasterCrossSigningKeyAllowReplacementWithoutUiaStmt).ExecContext(ctx, ts, userID, keyTypeInt) if err != nil { return -1, err }