@@ -52,12 +52,17 @@ rules:
5252 variables to minimize stack usage within the function.
5353 - name : prefer-constant-time
5454 trigger : >-
55- For private key based asymmetric algorithms implement in constant time
56- to prevent timing attacks and ensure security.
57- solution : >-
58- Review and refactor algorithms to ensure their execution time does not
59- depend on input values. Use constant-time libraries or functions where
60- applicable.
55+ Any code handling secret or private key data (symmetric or asymmetric)
56+ must be implemented in constant time. This includes cryptographic
57+ operations, key comparisons, and encoding/decoding operations (base64,
58+ hex, etc.) when processing secrets. Use constant-time implementations
59+ by default for all secret data since tracking when timing attacks are
60+ strictly possible is error-prone.
61+ solution : >-
62+ Review and refactor code to ensure execution time does not depend on
63+ secret values. Use constant-time functions such as ConstantCompare()
64+ for comparisons and avoid early-exit conditions based on secret data.
65+ When in doubt, assume constant-time handling is required.
6166 - name : use-sizeof
6267 trigger : >-
6368 Avoid hard-coded numeric values for sizes. Use `sizeof()` to ensure
@@ -154,4 +159,3 @@ rules:
154159 WOLFSSL_API. For functions local to the library but not static, use
155160 WOLFSSL_LOCAL and prefix the function name with wolfssl_local_ or wc_local_
156161 to clearly indicate internal usage.
157- -
0 commit comments