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:
Emilia Kasper
2015-10-06 17:20:32 +02:00
parent 0f0cfbe24c
commit 3101154481
9 changed files with 48 additions and 41 deletions

View File

@@ -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