Commit Graph
39 Commits
Author SHA1 Message Date
Nic BoetandClaude Opus 5.5 9f0a1a2bc6 feat: log a fingerprint of the auth hash instead of nothing
The previous commit stopped zmLoadAuthUser() logging the presented auth
hash, which also took away the only way to tell which hash a failed
attempt carried. Log "fp:" plus the first 8 hex digits of the hash's
SHA-256 instead: enough to match a zms or zm_rtsp_server line with the
web side's (ZM\logFingerprint() gives the same tag) or with a client's
own copy, and of no use for replaying or recovering the hash.

Adds SHA-256 to zm::crypto for both the OpenSSL and the GnuTLS backend.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 10:27:22 -05:00
Nic BoetandClaude Opus 5.5 df99a5ab27 fix: stop logging the auth hash secret and password hashes at debug level
zmLoadAuthUser() logged, at debug level 1, the auth_key it builds for each
candidate user and hour. That string starts with ZM_AUTH_HASH_SECRET, the
key that also signs JWT access tokens, followed by the username and the
stored password hash. User::getAuthHash() logged the same string, and the
presented ?auth= hash was logged as well. verifyPassword() logged the stored
and computed MySQL-style SHA1 password hashes.

Any daemon that checks an ?auth= hash (zms, zm_rtsp_server) with debug
enabled wrote these to its log file, and to the Logs table when database
logging is at Debug.

Log the username being checked instead, and drop the hash values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 10:27:22 -05:00
Aaron Kling c4683d90a9 Format code using astyle google format
Commands used:
astyle --style=google --indent=spaces=2 --keep-one-line-blocks src/*.cpp
astyle --style=google --indent=spaces=2 --keep-one-line-blocks src/*.h
2024-03-26 13:43:58 -05:00
Charlie Root da213d8532 Merge branch 'master' into openbsd 2023-09-11 13:42:43 -07:00
Alejandro Criado-Pérez 543683aa4c Corrections on cpp and h files 2023-08-13 01:27:19 +02:00
Isaac Connor 5989ac2e1f Use as_integer instead of as_int 2023-04-18 18:07:09 -04:00
Jonathan Bennett db3017de7d Adds the generateKey() function to zm_crypt 2022-09-07 15:49:47 -05:00
Isaac Connor 54a0f5d8df Fixup verifyToken to use refs for strings 2022-07-14 13:53:23 -04:00
Isaac Connor bc12205ec3 pass jwt_token_str and key by ref for performance 2022-07-14 09:46:24 -04:00
Peter Keresztes Schmidt 5d93555d9f Crypto: Use new hashing API 2021-05-30 22:56:21 +02:00
Isaac Connor 88a5afc1d2 Fix cpp-check reporting unused variable 2021-04-20 10:45:33 -04:00
Isaac Connor 51c4211ca6 Remove unused variable 2021-04-20 10:43:27 -04:00
Isaac Connor 1275948744 add cast to fix compile 2021-03-26 17:03:49 -04:00
Isaac Connor 79115e79f8 Fix jwt-cpp failing signature validation 2021-03-24 13:28:40 -04:00
Isaac Connor d1b816658b code style cleanups and add debug to tell which library we are using 2021-03-23 13:52:35 -04:00
Peter Keresztes Schmidt 37817f6ba4 dep/jwt-cpp: Update to version 0.5
Fixes some compile warnings. Unit tests pass with this version as well.
2021-03-01 23:14:56 +01:00
Isaac Connor 5ce9203d2c add include <cstring> 2021-02-04 17:07:25 -05:00
Peter Keresztes Schmidt 0dbc39ee25 Cleanup and reorganize includes
With this commit a unified structure for includes is introduced.
The general rules:
 * Only include what you need
 * Include wherever possible in the cpp and forward-declare in the header

 The includes are sorted in a local to global fashion. This means for the include order:
  0. If cpp file: The corresponding h file and an empty line
  1. Includes from the project sorted alphabetically
  2. System/library includes sorted alphabetically
  3. Conditional includes
2021-02-04 18:02:01 +01:00
Peter Keresztes Schmidt 5a57efdfe2 Replace deprecated C header includes with the C++ ones. 2021-02-04 05:39:03 +01:00
hax0kartik 2091ad8c92 Add libjwt and remove gnutls-openssl wrapper 2020-03-05 09:29:27 -08:00
Isaac Connor 64d024b0c0 Fix spacing 2019-08-28 10:33:18 -04:00
Isaac Connor 44e4d93445 Merge branch 'master' into storageareas 2019-06-24 11:35:36 -04:00
Pliable Pixels 299f994506 Fix zmcrypt message (#2645)
* added more clarity on zm_crypt authentication errors

* fixed variable name
2019-06-24 11:28:32 -04:00
Isaac Connor 470da03322 Merge sync fixes from storageareas 2019-06-20 15:14:20 -04:00
Isaac Connor 540a114c4b spacing google code style 2019-06-19 10:31:53 -04:00
Pliable Pixels 21710b6e49 demote logs 2019-05-12 15:45:39 -04:00
Pliable Pixels 1f22c38453 more fixes 2019-05-12 05:10:20 -04:00
Pliable Pixels 6ab31dfe4b more fixes 2019-05-12 05:03:16 -04:00
Pliable Pixels 3e66be27a8 use strtoul for conversion 2019-05-11 16:09:42 -04:00
Pliable Pixels 053e57af62 use strtoul for conversion 2019-05-11 16:01:05 -04:00
Pliable Pixels 96fa6149a8 use strtoul for conversion 2019-05-11 15:58:07 -04:00
Pliable Pixels ae14be916c initial plumbing to introduce token expiry and API bans per user 2019-05-11 13:39:40 -04:00
Pliable Pixels 0bb5ff934e move sha headers out 2019-05-08 19:17:31 -04:00
Pliable Pixels 4ab0c35962 move JWT/Bcrypt inside zm_crypt 2019-05-08 16:45:28 -04:00
Pliable Pixels 4c8d20db64 typo 2019-05-04 15:27:00 -04:00
Pliable Pixels 983e050fd7 fixed SHA1 algo 2019-05-04 15:20:31 -04:00
Pliable Pixels d952fe7117 Moved to openSSL SHA1, initial JWT plugin 2019-05-04 11:52:53 -04:00
Pliable Pixels ca2e7ea97c logs tweak 2019-05-03 12:01:13 -04:00
Pliable Pixels 72325d12b7 move to wrapper 2019-05-03 11:40:35 -04:00