Skip to content

test: refuse a session cookie that is not the stored one - #1012

Open
DrDoof wants to merge 1 commit into
RTLPlayground:mainfrom
DrDoof:test/httpd-session-negative
Open

DrDoof wants to merge 1 commit into
RTLPlayground:mainfrom
DrDoof:test/httpd-session-negative

Conversation

@DrDoof

@DrDoof DrDoof commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

The host tests never check that a wrong session cookie is refused: every scenario with a session uses the right cookie or none at all.

This adds a scenario to test_httpd_tx.c for an id that differs in one character, a prefix of the id, the id with a character added, an empty value, an empty value against an empty slot, an id that has timed out, and a login with a wrong password. All of them pass on main.

To see that they can fail I took the timeout check out of session_check(): the timeout case then fails. Taking out the test for an empty slot is not caught; the fixed-length compare refuses an empty value on its own.

Every scenario with a session used the right cookie or none. Nothing
checked that a wrong one is refused: an id that differs in one
character, a prefix, an id with a character added, an empty value, an
empty value against an empty slot, an id that has timed out, or a login
with a wrong password.

Add a scenario for these.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant