[tac_plus] tacacs+ 64 bit fix

Stephen Hemminger shemminger at vyatta.com
Thu Nov 5 19:22:04 UTC 2009


If tacacs+ server is compiled and run on 64 bit machine (common now).
On these machines sizeof(int) == 8 bytes, which is not same as uint32.
It will fail because the session_id which is declared as int will encrypted
as a 64 bit value. 

From fe31e5361c9e51096dacbc8c1f54b2a59366d3d1 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <shemminger at s6510.(none)>
Date: Thu, 5 Nov 2009 11:19:29 -0800
Subject: [PATCH] fix encrypt on 64 bit

---
 encrypt.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/encrypt.c b/encrypt.c
index a0971d0..2a5a341 100644
--- a/encrypt.c
+++ b/encrypt.c
@@ -37,9 +37,10 @@
  *
  *
  */
-void
-create_md5_hash(int session_id, char *key, u_char version, u_char seq_no,
-		u_char *prev_hash, u_char *hash)
+static void
+create_md5_hash(uint32_t session_id, const char *key, 
+		u_char version, u_char seq_no,
+		const u_char *prev_hash, u_char *hash)
 {
     u_char *md_stream, *mdp;
     int md_len;
-- 
1.6.3.3



More information about the tac_plus mailing list