From: Mike Yuan Date: Sat, 8 Nov 2025 05:39:43 +0000 (+0100) Subject: creds-util: use U64_* macros where appropriate X-Git-Tag: v259-rc1~92^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c7b5f7f30f605d85f1e0c079587a640c9a9efd8d;p=thirdparty%2Fsystemd.git creds-util: use U64_* macros where appropriate --- diff --git a/src/shared/creds-util.h b/src/shared/creds-util.h index 7b2fc76eb41..32c5a0ba88d 100644 --- a/src/shared/creds-util.h +++ b/src/shared/creds-util.h @@ -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);