DTLS: remove unused cookie field
Note that this commit constifies a user callback parameter and therefore will break compilation for applications using this callback. But unless they are abusing write access to the buffer, the fix is trivial. Reviewed-by: Andy Polyakov <appro@openssl.org>
This commit is contained in:
@@ -62,6 +62,7 @@
|
||||
# include <string.h>
|
||||
# include <openssl/bn.h>
|
||||
# include <openssl/buffer.h>
|
||||
# include <openssl/crypto.h>
|
||||
# include "e_os.h"
|
||||
|
||||
# ifdef __cplusplus
|
||||
@@ -124,6 +125,18 @@ static inline void PACKET_null_init(PACKET *pkt)
|
||||
pkt->remaining = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns 1 if the packet has length |num| and its contents equal the |num|
|
||||
* bytes read from |ptr|. Returns 0 otherwise (lengths or contents not equal).
|
||||
* If lengths are equal, performs the comparison in constant time.
|
||||
*/
|
||||
__owur static inline int PACKET_equal(const PACKET *pkt, const void *ptr,
|
||||
size_t num) {
|
||||
if (PACKET_remaining(pkt) != num)
|
||||
return 0;
|
||||
return CRYPTO_memcmp(pkt->curr, ptr, num) == 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Peek ahead and initialize |subpkt| with the next |len| bytes read from |pkt|.
|
||||
* Data is not copied: the |subpkt| packet will share its underlying buffer with
|
||||
|
||||
Reference in New Issue
Block a user