Skip to content

Conversation

@etr
Copy link
Owner

@etr etr commented Jan 30, 2026

Summary

  • Adds check_digest_auth_ha1() method to http_request that accepts pre-computed HA1 hash bytes instead of plaintext password
  • This allows secure storage of password hashes rather than plaintext passwords
  • Adds digest_algorithm enum with MD5 and SHA256 values (no AUTO since libmicrohttpd cannot auto-detect algorithm from raw hash bytes)
  • Adds md5_digest_size (16) and sha256_digest_size (32) constants

Test plan

  • All existing tests pass (12/12)
  • New integration tests for HA1-based digest authentication added

etr added 2 commits January 30, 2026 11:58
Adds check_digest_auth_ha1() method that accepts pre-computed HA1 hash
bytes instead of plaintext password. This allows secure storage of
password hashes rather than plaintext passwords.

Changes:
- Add digest_algorithm enum (MD5, SHA256) without AUTO since
  libmicrohttpd cannot auto-detect algorithm from raw hash bytes
- Add md5_digest_size and sha256_digest_size constants
- Add check_digest_auth_ha1() to http_request
- Add integration tests for HA1-based digest authentication
- Add algorithm parameter to digest_auth_fail_response constructor
  (defaults to MD5 for backward compatibility)
- Use MHD_queue_auth_fail_response2() to specify the algorithm in
  the WWW-Authenticate challenge header
- Add separate MD5 and SHA256 test resources for deterministic testing
- Add SHA256 digest auth tests alongside existing MD5 tests

This enables server-driven algorithm selection, where the server
requests a specific digest algorithm in the challenge and curl
responds using that algorithm.
@etr etr merged commit e06f83a into master Jan 30, 2026
39 checks passed
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.

2 participants