diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2007-10-18 09:47:58 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2007-10-18 09:47:58 +0000 |
commit | 25835069fa09a6851aa4658d033c5047452b25bb (patch) | |
tree | b616f93717efebfac21ed9d9d5523d3babfc4e89 /usr.sbin/ripd/ripd.h | |
parent | 4403581f7f9e4bbacd069262b9d848164b8c6537 (diff) |
Massive cleanup in the authentication code. the simple auth_key and the crypt
keys are not strings so a) use u_int8_t instead of char and b) uses memcpy
to copy the full MAX_SIMPLE_AUTH_LEN resp. MD5_DIGEST_LENGTH bytes around.
The parser needs some special code to ensure that the string is not to long
and if it is shorter then the buffer the rest needs to be zero padded.
Avoid to use strncpy() instead use a bzero(); memcpy() combo.
with and OK deraadt@
Diffstat (limited to 'usr.sbin/ripd/ripd.h')
-rw-r--r-- | usr.sbin/ripd/ripd.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/ripd/ripd.h b/usr.sbin/ripd/ripd.h index a4508133bdb..8571010c28c 100644 --- a/usr.sbin/ripd/ripd.h +++ b/usr.sbin/ripd/ripd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ripd.h,v 1.7 2007/09/11 18:05:36 claudio Exp $ */ +/* $OpenBSD: ripd.h,v 1.8 2007/10/18 09:47:57 claudio Exp $ */ /* * Copyright (c) 2004 Esben Norby <norby@openbsd.org> @@ -184,7 +184,7 @@ enum iface_type { struct auth_md { TAILQ_ENTRY(auth_md) entry; u_int32_t seq_modulator; - char key[MD5_DIGEST_LENGTH]; + u_int8_t key[MD5_DIGEST_LENGTH]; u_int8_t keyid; }; @@ -205,7 +205,7 @@ struct iface { LIST_HEAD(, nbr) nbr_list; LIST_HEAD(, nbr_failed) failed_nbr_list; char name[IF_NAMESIZE]; - char auth_key[MAX_SIMPLE_AUTH_LEN]; + u_int8_t auth_key[MAX_SIMPLE_AUTH_LEN]; struct in_addr addr; struct in_addr dst; struct in_addr mask; |