[27160] in CVS-changelog-for-Kerberos-V5
krb5 commit: Avoid bit shifting in krb5.h constants
daemon@ATHENA.MIT.EDU (Greg Hudson)
Tue Oct 16 16:28:56 2012
Date: Tue, 16 Oct 2012 16:28:53 -0400
From: Greg Hudson <ghudson@mit.edu>
Message-Id: <201210162028.q9GKSrcR016443@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu
https://github.com/krb5/krb5/commit/ec4b05380dcbc0550da2dcac497ebdd980b815b8
commit ec4b05380dcbc0550da2dcac497ebdd980b815b8
Author: Greg Hudson <ghudson@mit.edu>
Date: Tue Oct 16 16:23:49 2012 -0400
Avoid bit shifting in krb5.h constants
Our traditional practice is to use hex integer literals for flag bits.
Bit shifting can be dangerous because shifting into the sign bit is
undefined. Convert existing bit shift expressions to hex literals.
src/include/krb5/krb5.hin | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/include/krb5/krb5.hin b/src/include/krb5/krb5.hin
index 13ada8f..3deb7a7 100644
--- a/src/include/krb5/krb5.hin
+++ b/src/include/krb5/krb5.hin
@@ -6413,19 +6413,19 @@ krb5_prompter_posix(krb5_context context, void *data, const char *name,
/**
* This flag indicates that the token value MUST be collected.
*/
-#define KRB5_RESPONDER_OTP_FLAGS_COLLECT_TOKEN (1 << 0)
+#define KRB5_RESPONDER_OTP_FLAGS_COLLECT_TOKEN 0x0001
/**
* This flag indicates that the PIN value MUST be collected.
*/
-#define KRB5_RESPONDER_OTP_FLAGS_COLLECT_PIN (1 << 1)
+#define KRB5_RESPONDER_OTP_FLAGS_COLLECT_PIN 0x0002
/**
* This flag indicates that the token is now in re-synchronization mode with
* the server. The user is expected to reply with the next code displayed on
* the token.
*/
-#define KRB5_RESPONDER_OTP_FLAGS_NEXTOTP (1 << 2)
+#define KRB5_RESPONDER_OTP_FLAGS_NEXTOTP 0x0004
/**
* This flag indicates that the PIN MUST be returned as a separate item. This
@@ -6434,7 +6434,7 @@ krb5_prompter_posix(krb5_context context, void *data, const char *name,
* and store it as "value" in the answer or it may return them separately. If
* they are returned separately, they will be concatenated internally.
*/
-#define KRB5_RESPONDER_OTP_FLAGS_SEPARATE_PIN (1 << 3)
+#define KRB5_RESPONDER_OTP_FLAGS_SEPARATE_PIN 0x0008
typedef struct krb5_responder_context_st *krb5_responder_context;
@@ -6871,7 +6871,7 @@ krb5_get_init_creds_opt_get_fast_flags(krb5_context context,
krb5_flags *out_flags);
/* Fast flags*/
-#define KRB5_FAST_REQUIRED 1l<<0 /**< Require KDC to support FAST*/
+#define KRB5_FAST_REQUIRED 0x0001 /**< Require KDC to support FAST*/
typedef void
(KRB5_CALLCONV *krb5_expire_callback_func)(krb5_context context, void *data,
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5