fix: replace crypto/md5 with crypto/sha256 for IP hashing

This commit is contained in:
2026-07-10 12:04:49 +01:00
parent d1e85bb855
commit ef3cfe8c4f
3 changed files with 8 additions and 8 deletions
+3 -3
View File
@@ -5,7 +5,7 @@ package bookings
import (
"bytes"
"context"
"crypto/md5"
"crypto/sha256"
"encoding/json"
"fmt"
"net/http"
@@ -1938,7 +1938,7 @@ func TestReserveSlot_CleansUpAnonReservation(t *testing.T) {
// Set a known IP that the test request will use
testIP := "192.0.2.1"
ipHash := fmt.Sprintf("%x", md5.Sum([]byte(testIP)))[:8]
ipHash := fmt.Sprintf("%x", sha256.Sum256([]byte(testIP)))[:8]
// Create an anonymous reservation (created_by = NULL) matching this IP hash
var blockerID string
@@ -2139,7 +2139,7 @@ func TestAdminReserveSlot_CleansUpAnonReservation(t *testing.T) {
future := weekdayTime(time.Monday, 10)
testIP := "192.0.2.2"
ipHash := fmt.Sprintf("%x", md5.Sum([]byte(testIP)))[:8]
ipHash := fmt.Sprintf("%x", sha256.Sum256([]byte(testIP)))[:8]
// Create an anonymous reservation matching this IP
var blockerID string