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
+2 -2
View File
@@ -2,7 +2,7 @@ package bookings
import (
"context"
"crypto/md5"
"crypto/sha256"
"crussell/clock"
"crussell/db"
"crussell/handlers/scheduling"
@@ -152,7 +152,7 @@ func AdminReserveSlotHandler(w http.ResponseWriter, r *http.Request) {
ip = r.RemoteAddr
}
}
ipHash := fmt.Sprintf("%x", md5.Sum([]byte(ip)))[:8]
ipHash := fmt.Sprintf("%x", sha256.Sum256([]byte(ip)))[:8]
if _, delErr := db.Conn.Exec(r.Context(), `
DELETE FROM time_blockers
WHERE (description LIKE 'RESERVATION:admin:%' AND created_by = $1)