Browse code

crypto: Make sure crypto flags are treated as unsigned

crypto_options.flags is already unsigned, make sure the
flags are as well to avoid spurious conversion warnings.

Change-Id: I89820c76e2e099f7acb817c71c8aeb83736ac556
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Message-Id: <20250826184935.22110-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg32688.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>

Frank Lichtenheld authored on 2025/08/27 03:49:29
Showing 1 changed files
... ...
@@ -342,39 +342,39 @@ struct crypto_options
342 342
      *   keeping state between successive
343 343
      *   OpenVPN process startups. */
344 344
 
345
-#define CO_PACKET_ID_LONG_FORM         (1 << 0)
345
+#define CO_PACKET_ID_LONG_FORM         (1u << 0)
346 346
     /**< Bit-flag indicating whether to use
347 347
      *   OpenVPN's long packet ID format. */
348
-#define CO_IGNORE_PACKET_ID            (1 << 1)
348
+#define CO_IGNORE_PACKET_ID            (1u << 1)
349 349
     /**< Bit-flag indicating whether to ignore
350 350
      *   the packet ID of a received packet.
351 351
      *   This flag is used during processing
352 352
      *   of the first packet received from a
353 353
      *   client. */
354
-#define CO_MUTE_REPLAY_WARNINGS        (1 << 2)
354
+#define CO_MUTE_REPLAY_WARNINGS        (1u << 2)
355 355
     /**< Bit-flag indicating not to display
356 356
      *   replay warnings. */
357
-#define CO_USE_TLS_KEY_MATERIAL_EXPORT (1 << 3)
357
+#define CO_USE_TLS_KEY_MATERIAL_EXPORT (1u << 3)
358 358
     /**< Bit-flag indicating that data channel key derivation
359 359
      * is done using TLS keying material export [RFC5705]
360 360
      */
361
-#define CO_RESEND_WKC                  (1 << 4)
361
+#define CO_RESEND_WKC                  (1u << 4)
362 362
     /**< Bit-flag indicating that the client is expected to
363 363
      * resend the wrapped client key with the 2nd packet (packet-id 1)
364 364
      * like with the HARD_RESET_CLIENT_V3 packet */
365
-#define CO_FORCE_TLSCRYPTV2_COOKIE     (1 << 5)
365
+#define CO_FORCE_TLSCRYPTV2_COOKIE     (1u << 5)
366 366
     /**< Bit-flag indicating that we do not allow clients that do
367 367
      * not support resending the wrapped client key (WKc) with the
368 368
      * third packet of the three-way handshake */
369
-#define CO_USE_CC_EXIT_NOTIFY          (1 << 6)
369
+#define CO_USE_CC_EXIT_NOTIFY          (1u << 6)
370 370
     /**< Bit-flag indicating that explicit exit notifies should be
371 371
      * sent via the control channel instead of using an OCC message
372 372
      */
373
-#define CO_USE_DYNAMIC_TLS_CRYPT       (1 << 7)
373
+#define CO_USE_DYNAMIC_TLS_CRYPT       (1u << 7)
374 374
     /**< Bit-flag indicating that renegotiations are using tls-crypt
375 375
      *   with a TLS-EKM derived key.
376 376
      */
377
-#define CO_EPOCH_DATA_KEY_FORMAT       (1 << 8)
377
+#define CO_EPOCH_DATA_KEY_FORMAT       (1u << 8)
378 378
     /**< Bit-flag indicating the epoch the data format. This format
379 379
      * has the AEAD tag at the end of the packet and is using a longer
380 380
      * 64-bit packet id that is split into a 16 bit epoch and 48 bit