]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
creds-util: use U64_* macros where appropriate
authorMike Yuan <me@yhndnzj.com>
Sat, 8 Nov 2025 05:39:43 +0000 (06:39 +0100)
committerMike Yuan <me@yhndnzj.com>
Mon, 10 Nov 2025 21:38:21 +0000 (22:38 +0100)
src/shared/creds-util.h

index 7b2fc76eb419f270842c83dd7fd4e680a018d59f..32c5a0ba88d6349f708bd5623da1ebae1724f1c7 100644 (file)
@@ -9,7 +9,7 @@
 #define CREDENTIAL_NAME_MAX FDNAME_MAX
 
 /* Put a size limit on the individual credential */
-#define CREDENTIAL_SIZE_MAX (1024U*1024U)
+#define CREDENTIAL_SIZE_MAX (1U * U64_MB)
 
 /* Refuse to store more than 1M per service, after all this is unswappable memory. Note that for now we put
  * this to the same limit as the per-credential limit, i.e. if the user has n > 1 credentials instead of 1 it
@@ -18,7 +18,7 @@
 
 /* Put a size limit on encrypted credentials (which is the same as the unencrypted size plus a spacious 128K of extra
  * space for headers, IVs, exported TPM2 key material and so on. */
-#define CREDENTIAL_ENCRYPTED_SIZE_MAX (CREDENTIAL_SIZE_MAX + 128U*1024U)
+#define CREDENTIAL_ENCRYPTED_SIZE_MAX (CREDENTIAL_SIZE_MAX + 128U * U64_KB)
 
 bool credential_name_valid(const char *s);
 bool credential_glob_valid(const char *s);