summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsing <>2020-02-21 16:07:00 +0000
committerjsing <>2020-02-21 16:07:00 +0000
commitc82fc1d12d2d1ee86362f6c1b6cc207c4289516e (patch)
treea13678b1a92e77c3f4055a2ceb7e1a2de01aa28a
parent36aff3b8e061cda65ce463816541616b9339d768 (diff)
downloadopenbsd-c82fc1d12d2d1ee86362f6c1b6cc207c4289516e.tar.gz
openbsd-c82fc1d12d2d1ee86362f6c1b6cc207c4289516e.tar.bz2
openbsd-c82fc1d12d2d1ee86362f6c1b6cc207c4289516e.zip
Move l2n/l2n8 into s3_cbc.c, since this is the only code that uses it.
ok inoguchi@ tb@
-rw-r--r--src/lib/libssl/s3_cbc.c16
-rw-r--r--src/lib/libssl/ssl_locl.h16
2 files changed, 16 insertions, 16 deletions
diff --git a/src/lib/libssl/s3_cbc.c b/src/lib/libssl/s3_cbc.c
index a1c0ce6b90..4b66e1f17a 100644
--- a/src/lib/libssl/s3_cbc.c
+++ b/src/lib/libssl/s3_cbc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s3_cbc.c,v 1.17 2018/09/08 14:39:41 jsing Exp $ */ 1/* $OpenBSD: s3_cbc.c,v 1.18 2020/02/21 16:07:00 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2012 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2012 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -266,6 +266,20 @@ ssl3_cbc_copy_mac(unsigned char* out, const SSL3_RECORD *rec,
266#endif 266#endif
267} 267}
268 268
269#define l2n(l,c) (*((c)++)=(unsigned char)(((l)>>24)&0xff), \
270 *((c)++)=(unsigned char)(((l)>>16)&0xff), \
271 *((c)++)=(unsigned char)(((l)>> 8)&0xff), \
272 *((c)++)=(unsigned char)(((l) )&0xff))
273
274#define l2n8(l,c) (*((c)++)=(unsigned char)(((l)>>56)&0xff), \
275 *((c)++)=(unsigned char)(((l)>>48)&0xff), \
276 *((c)++)=(unsigned char)(((l)>>40)&0xff), \
277 *((c)++)=(unsigned char)(((l)>>32)&0xff), \
278 *((c)++)=(unsigned char)(((l)>>24)&0xff), \
279 *((c)++)=(unsigned char)(((l)>>16)&0xff), \
280 *((c)++)=(unsigned char)(((l)>> 8)&0xff), \
281 *((c)++)=(unsigned char)(((l) )&0xff))
282
269/* u32toLE serialises an unsigned, 32-bit number (n) as four bytes at (p) in 283/* u32toLE serialises an unsigned, 32-bit number (n) as four bytes at (p) in
270 * little-endian order. The value of p is advanced by four. */ 284 * little-endian order. The value of p is advanced by four. */
271#define u32toLE(n, p) \ 285#define u32toLE(n, p) \
diff --git a/src/lib/libssl/ssl_locl.h b/src/lib/libssl/ssl_locl.h
index f5f7a8348e..e557c2e9fc 100644
--- a/src/lib/libssl/ssl_locl.h
+++ b/src/lib/libssl/ssl_locl.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_locl.h,v 1.264 2020/02/06 17:35:22 jsing Exp $ */ 1/* $OpenBSD: ssl_locl.h,v 1.265 2020/02/21 16:07:00 jsing 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 *
@@ -169,20 +169,6 @@ __BEGIN_HIDDEN_DECLS
169#define CTASSERT(x) extern char _ctassert[(x) ? 1 : -1 ] \ 169#define CTASSERT(x) extern char _ctassert[(x) ? 1 : -1 ] \
170 __attribute__((__unused__)) 170 __attribute__((__unused__))
171 171
172#define l2n(l,c) (*((c)++)=(unsigned char)(((l)>>24)&0xff), \
173 *((c)++)=(unsigned char)(((l)>>16)&0xff), \
174 *((c)++)=(unsigned char)(((l)>> 8)&0xff), \
175 *((c)++)=(unsigned char)(((l) )&0xff))
176
177#define l2n8(l,c) (*((c)++)=(unsigned char)(((l)>>56)&0xff), \
178 *((c)++)=(unsigned char)(((l)>>48)&0xff), \
179 *((c)++)=(unsigned char)(((l)>>40)&0xff), \
180 *((c)++)=(unsigned char)(((l)>>32)&0xff), \
181 *((c)++)=(unsigned char)(((l)>>24)&0xff), \
182 *((c)++)=(unsigned char)(((l)>>16)&0xff), \
183 *((c)++)=(unsigned char)(((l)>> 8)&0xff), \
184 *((c)++)=(unsigned char)(((l) )&0xff))
185
186#define s2n(s,c) ((c[0]=(unsigned char)(((s)>> 8)&0xff), \ 172#define s2n(s,c) ((c[0]=(unsigned char)(((s)>> 8)&0xff), \
187 c[1]=(unsigned char)(((s) )&0xff)),c+=2) 173 c[1]=(unsigned char)(((s) )&0xff)),c+=2)
188 174