fix: replace crypto/md5 with crypto/sha256 for IP hashing
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user