Skip to content

fix: guard TOTP counter overflow - #21

Merged
LimiNode merged 1 commit into
mainfrom
codex/guard-counter-computation-in-is_totp_token_valid
Sep 3, 2025
Merged

fix: guard TOTP counter overflow#21
LimiNode merged 1 commit into
mainfrom
codex/guard-counter-computation-in-is_totp_token_valid

Conversation

@LimiNode

@LimiNode LimiNode commented Sep 3, 2025

Copy link
Copy Markdown
Owner

Summary

  • avoid overflow when validating TOTP tokens
  • document overflow behavior and extend tests

Testing

  • g++ -std=c++17 test_totp.cpp hmac_utils.cpp hmac.cpp sha1.cpp sha256.cpp sha512.cpp -o test_totp && ./test_totp
  • g++ -std=c++17 test_all.cpp hmac_utils.cpp hmac.cpp sha1.cpp sha256.cpp sha512.cpp -lgtest -lpthread -o test_all && ./test_all (fails: gtest/gtest.h: No such file or directory)

https://chatgpt.com/codex/tasks/task_e_68b8b3cc84d8832c830524f04415995f

Add tests for counter overflow and adjust message output.
@LimiNode
LimiNode merged commit f77b8ca into main Sep 3, 2025
4 checks passed
@LimiNode
LimiNode deleted the codex/guard-counter-computation-in-is_totp_token_valid branch September 4, 2025 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant