Added a fix to only hash valid PINs in SaveOthersTemporaryPin

This commit is contained in:
Alfred Kamanda 2025-02-21 11:49:51 +03:00
parent 91c4967efa
commit e8e6f0e371
Signed by: Alfred-mk
GPG Key ID: 7EA3D01708908703

View File

@ -384,6 +384,12 @@ func (h *MenuHandlers) SaveOthersTemporaryPin(ctx context.Context, sym string, i
} }
temporaryPin := string(input) temporaryPin := string(input)
// Validate that the input is a 4-digit number.
if !pin.IsValidPIN(temporaryPin) {
return res, nil
}
// Retrieve the blocked number associated with this session // Retrieve the blocked number associated with this session
blockedNumber, err := store.ReadEntry(ctx, sessionId, storedb.DATA_BLOCKED_NUMBER) blockedNumber, err := store.ReadEntry(ctx, sessionId, storedb.DATA_BLOCKED_NUMBER)
if err != nil { if err != nil {