Skip to content

Validate TOTP parameters - #17

Merged
LimiNode merged 1 commit into
mainfrom
codex/add-input-validation-and-exceptions-for-totp-functions
Sep 3, 2025
Merged

Validate TOTP parameters#17
LimiNode merged 1 commit into
mainfrom
codex/add-input-validation-and-exceptions-for-totp-functions

Conversation

@LimiNode

@LimiNode LimiNode commented Sep 3, 2025

Copy link
Copy Markdown
Owner

Summary

  • Throw std::invalid_argument when TOTP period is non-positive or digits are outside [1,9]
  • Document parameter validation and exception behavior in hmac_utils.hpp

Testing

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

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

@LimiNode
LimiNode merged commit 5b855a2 into main Sep 3, 2025
4 checks passed
@LimiNode
LimiNode deleted the codex/add-input-validation-and-exceptions-for-totp-functions 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