[tac_plus] Re: tacacs+ 64 bit fix
john heasley
heas at shrubbery.net
Thu Nov 5 19:39:18 UTC 2009
Thu, Nov 05, 2009 at 11:22:04AM -0800, Stephen Hemminger:
> 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.
thats not right. int should be 4 bytes on all machines as defined by
spec. long should be 8 bytes on 64bit machines.
what o/s and what version of tacacs?
> >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
>
> _______________________________________________
> tac_plus mailing list
> tac_plus at shrubbery.net
> http://www.shrubbery.net/mailman/listinfo.cgi/tac_plus
More information about the tac_plus
mailing list