summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl3.h
diff options
context:
space:
mode:
authorbcook <>2014-12-14 21:49:29 +0000
committerbcook <>2014-12-14 21:49:29 +0000
commit02216b57a0ccb0dd187f3ea646c6ae40e827d3ae (patch)
tree4192f8b6f420704e7598dbfb017975afb1eebace /src/lib/libssl/ssl3.h
parent9d7627cb78b8d58f06310b08151767a7309504dc (diff)
downloadopenbsd-02216b57a0ccb0dd187f3ea646c6ae40e827d3ae.tar.gz
openbsd-02216b57a0ccb0dd187f3ea646c6ae40e827d3ae.tar.bz2
openbsd-02216b57a0ccb0dd187f3ea646c6ae40e827d3ae.zip
unconditionally align SSL payloads
Remove support for conditional payload alignment, since we would never want to turn it off. Also, consistently use size_t for calculating the alignment. ok miod@
Diffstat (limited to 'src/lib/libssl/ssl3.h')
-rw-r--r--src/lib/libssl/ssl3.h17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/lib/libssl/ssl3.h b/src/lib/libssl/ssl3.h
index b5df1056ab..5f59e18eb4 100644
--- a/src/lib/libssl/ssl3.h
+++ b/src/lib/libssl/ssl3.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl3.h,v 1.32 2014/12/14 16:07:26 jsing Exp $ */ 1/* $OpenBSD: ssl3.h,v 1.33 2014/12/14 21:49:29 bcook Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -236,20 +236,7 @@ extern "C" {
236#define SSL3_RT_HEADER_LENGTH 5 236#define SSL3_RT_HEADER_LENGTH 5
237#define SSL3_HM_HEADER_LENGTH 4 237#define SSL3_HM_HEADER_LENGTH 4
238 238
239#ifndef SSL3_ALIGN_PAYLOAD 239#define SSL3_ALIGN_PAYLOAD 8
240 /* Some will argue that this increases memory footprint, but it's
241 * not actually true. Point is that malloc has to return at least
242 * 64-bit aligned pointers, meaning that allocating 5 bytes wastes
243 * 3 bytes in either case. Suggested pre-gaping simply moves these
244 * wasted bytes from the end of allocated region to its front,
245 * but makes data payload aligned, which improves performance:-) */
246# define SSL3_ALIGN_PAYLOAD 8
247#else
248# if (SSL3_ALIGN_PAYLOAD&(SSL3_ALIGN_PAYLOAD-1))!=0
249# error "insane SSL3_ALIGN_PAYLOAD"
250# undef SSL3_ALIGN_PAYLOAD
251# endif
252#endif
253 240
254/* This is the maximum MAC (digest) size used by the SSL library. 241/* This is the maximum MAC (digest) size used by the SSL library.
255 * Currently maximum of 20 is used by SHA1, but we reserve for 242 * Currently maximum of 20 is used by SHA1, but we reserve for