diff options
author | rrs <rrs@FreeBSD.org> | 2007-02-12 23:24:31 +0000 |
---|---|---|
committer | rrs <rrs@FreeBSD.org> | 2007-02-12 23:24:31 +0000 |
commit | e176cc33f53a2dee7896aec59f970825b57845b8 (patch) | |
tree | 6152741c43ebcb3fc304c4834897a4966cc8bdbd /sys/netinet/sctp_auth.h | |
parent | 725b149c2db3f8bc35268426a9c1719420d722fa (diff) | |
download | FreeBSD-src-e176cc33f53a2dee7896aec59f970825b57845b8.zip FreeBSD-src-e176cc33f53a2dee7896aec59f970825b57845b8.tar.gz |
- Copyright updates (aka 2007)
- ZONE get now also take a type cast so it does the
cast like mtod does.
- New macro SCTP_LIST_EMPTY, which in bsd is just
LIST_EMPTY
- Removal of const in some of the static hmac functions
(not needed)
- Store length changes to allow for new fields in auth
- Auth code updated to current draft (this should be the
RFC version we think).
- use uint8_t instead of u_char in LOOPBACK address comparison
- Some u_int32_t converted to uint32_t (in crc code)
- A bug was found in the mib counts for ordered/unordered
count, this was fixed (was referencing a freed mbuf).
- SCTP_ASOCLOG_OF_TSNS added (code will probably disappear
after my testing completes. It allows us to keep a
small log on each assoc of the last 40 TSN's in/out and
stream assignment. It is NOT in options and so is only
good for private builds.
- Some CMT changes in prep for Jana fixing his problem
with reneging when CMT is enabled (Concurrent Multipath
Transfer = CMT).
- Some missing mib stats added.
- Correction to number of open assoc's count in mib
- Correction to os_bsd.h to get right sha2 macros
- Add of special AUTH_04 flags so you can compile the code
with the old format (in case the peer does not yet support
the latest auth code).
- Nonce sum was incorrectly being set in when ecn_nonce was
NOT on.
- LOR in listen with implicit bind found and fixed.
- Moved away from using mbuf's for socket options to using
just data pointers. The mbufs were used to harmonize
NetBSD code since both Net and Open used this method. We
have decided to move away from that and more conform to
FreeBSD style (which makes more sense).
- Very very nasty bug found in some of my "debug" code. The
cookie_how collision case tracking had an endless loop in
it if you got a second retransmission of a cookie collision
case. This would lock up a CPU .. ugly..
- auth function goes to using size_t instead of int which
conforms to socketapi better
- Found the nasty bug that happens after 9 days of testing.. you
get the data chunk, deliver it and due to the reference to a ch->
that every now and then has been deleted (depending on the postion
in the mbuf) you have an invalid ch->ch.flags.. and thus you don't
advance the stream sequence number.. so you block the stream
permanently. The fix is to make local variables of these guys
and set them up before you have any chance of trimming the
mbuf.
- style fix in sctp_util.h, not sure how this got bad maybe in
the last patch? (aka it may not be in the real source).
- Found interesting bug when using the extended snd/rcv info where
we would get an error on receiving with this. Thats because
it was NOT padded to the same size as the snd_rcv info. We
increase (add the pad) so the two structs are the same size
in sctp_uio.h
- In sctp_usrreq.c one of the most common things we did for
socket options was to cast the pointer and validate the size.
This as been macro-ized to help make the code more readable.
- in sctputil.c two things, the socketapi class found a missing
flag type (the next msg is a notification) and a missing
scope recovery was also fixed.
Reviewed by: gnn
Diffstat (limited to 'sys/netinet/sctp_auth.h')
-rw-r--r-- | sys/netinet/sctp_auth.h | 41 |
1 files changed, 8 insertions, 33 deletions
diff --git a/sys/netinet/sctp_auth.h b/sys/netinet/sctp_auth.h index c6eb88a..5d0f4da 100644 --- a/sys/netinet/sctp_auth.h +++ b/sys/netinet/sctp_auth.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2001-2006, Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2001-2007, Cisco Systems, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -30,33 +30,10 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#define HAVE_SHA2 #ifndef __SCTP_AUTH_H__ #define __SCTP_AUTH_H__ -#include <sys/queue.h> -#include <sys/mbuf.h> - -#ifdef USE_SCTP_SHA1 -#include <netinet/sctp_sha1.h> -#else -#include <crypto/sha1.h> -/* map standard crypto API names */ -#define SHA1_Init SHA1Init -#define SHA1_Update SHA1Update -#define SHA1_Final(x,y) SHA1Final((caddr_t)x, y) -#endif - -#if defined(HAVE_SHA2) -#include <crypto/sha2/sha2.h> -#endif - -#include <sys/md5.h> -/* map standard crypto API names */ -#define MD5_Init MD5Init -#define MD5_Update MD5Update -#define MD5_Final MD5Final /* digest lengths */ #define SCTP_AUTH_DIGEST_LEN_SHA1 20 @@ -145,11 +122,10 @@ extern void sctp_clear_chunklist(sctp_auth_chklist_t * chklist); extern sctp_auth_chklist_t *sctp_copy_chunklist(sctp_auth_chklist_t * chklist); extern int sctp_auth_add_chunk(uint8_t chunk, sctp_auth_chklist_t * list); extern int sctp_auth_delete_chunk(uint8_t chunk, sctp_auth_chklist_t * list); -extern int sctp_auth_get_chklist_size(const sctp_auth_chklist_t * list); +extern size_t sctp_auth_get_chklist_size(const sctp_auth_chklist_t * list); extern void sctp_auth_set_default_chunks(sctp_auth_chklist_t * list); extern int -sctp_serialize_auth_chunks(const sctp_auth_chklist_t * list, - uint8_t * ptr); + sctp_serialize_auth_chunks(const sctp_auth_chklist_t * list, uint8_t * ptr); extern int sctp_pack_auth_chunks(const sctp_auth_chklist_t * list, uint8_t * ptr); extern int sctp_unpack_auth_chunks(const uint8_t * ptr, uint8_t num_chunks, @@ -170,8 +146,7 @@ sctp_compute_hashkey(sctp_key_t * key1, sctp_key_t * key2, extern sctp_sharedkey_t *sctp_alloc_sharedkey(void); extern void sctp_free_sharedkey(sctp_sharedkey_t * skey); extern sctp_sharedkey_t * -sctp_find_sharedkey(struct sctp_keyhead *shared_keys, - uint16_t key_id); + sctp_find_sharedkey(struct sctp_keyhead *shared_keys, uint16_t key_id); extern void sctp_insert_sharedkey(struct sctp_keyhead *shared_keys, sctp_sharedkey_t * new_skey); @@ -185,7 +160,7 @@ extern void sctp_free_hmaclist(sctp_hmaclist_t * list); extern int sctp_auth_add_hmacid(sctp_hmaclist_t * list, uint16_t hmac_id); extern sctp_hmaclist_t *sctp_copy_hmaclist(sctp_hmaclist_t * list); extern sctp_hmaclist_t *sctp_default_supported_hmaclist(void); -extern uint16_t +extern uint16_t sctp_negotiate_hmacid(sctp_hmaclist_t * peer, sctp_hmaclist_t * local); extern int sctp_serialize_hmaclist(sctp_hmaclist_t * list, uint8_t * ptr); @@ -201,14 +176,14 @@ extern uint32_t sctp_get_auth_chunk_len(uint16_t hmac_algo); extern uint32_t sctp_get_hmac_digest_len(uint16_t hmac_algo); extern uint32_t sctp_hmac(uint16_t hmac_algo, uint8_t * key, uint32_t keylen, - const uint8_t * text, uint32_t textlen, uint8_t * digest); + uint8_t * text, uint32_t textlen, uint8_t * digest); extern int sctp_verify_hmac(uint16_t hmac_algo, uint8_t * key, uint32_t keylen, - const uint8_t * text, uint32_t textlen, uint8_t * digest, + uint8_t * text, uint32_t textlen, uint8_t * digest, uint32_t digestlen); extern uint32_t sctp_compute_hmac(uint16_t hmac_algo, sctp_key_t * key, - const uint8_t * text, uint32_t textlen, uint8_t * digest); + uint8_t * text, uint32_t textlen, uint8_t * digest); extern int sctp_auth_is_supported_hmac(sctp_hmaclist_t * list, uint16_t id); /* mbuf versions */ |