summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2020-02-21 16:07:00 +0000
committerjsing <jsing@openbsd.org>2020-02-21 16:07:00 +0000
commitf2e6ddf73da1e1277327eabc389b57d1cb2ceca2 (patch)
tree01b0979a08d1c079a0797c6dcae1f15a73857671
parentRemove prefix_len, since it is always zero. (diff)
downloadwireguard-openbsd-f2e6ddf73da1e1277327eabc389b57d1cb2ceca2.tar.xz
wireguard-openbsd-f2e6ddf73da1e1277327eabc389b57d1cb2ceca2.zip
Move l2n/l2n8 into s3_cbc.c, since this is the only code that uses it.
ok inoguchi@ tb@
-rw-r--r--lib/libssl/s3_cbc.c16
-rw-r--r--lib/libssl/ssl_locl.h16
2 files changed, 16 insertions, 16 deletions
diff --git a/lib/libssl/s3_cbc.c b/lib/libssl/s3_cbc.c
index a1c0ce6b908..4b66e1f17aa 100644
--- a/lib/libssl/s3_cbc.c
+++ b/lib/libssl/s3_cbc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: s3_cbc.c,v 1.17 2018/09/08 14:39:41 jsing Exp $ */
+/* $OpenBSD: s3_cbc.c,v 1.18 2020/02/21 16:07:00 jsing Exp $ */
/* ====================================================================
* Copyright (c) 2012 The OpenSSL Project. All rights reserved.
*
@@ -266,6 +266,20 @@ ssl3_cbc_copy_mac(unsigned char* out, const SSL3_RECORD *rec,
#endif
}
+#define l2n(l,c) (*((c)++)=(unsigned char)(((l)>>24)&0xff), \
+ *((c)++)=(unsigned char)(((l)>>16)&0xff), \
+ *((c)++)=(unsigned char)(((l)>> 8)&0xff), \
+ *((c)++)=(unsigned char)(((l) )&0xff))
+
+#define l2n8(l,c) (*((c)++)=(unsigned char)(((l)>>56)&0xff), \
+ *((c)++)=(unsigned char)(((l)>>48)&0xff), \
+ *((c)++)=(unsigned char)(((l)>>40)&0xff), \
+ *((c)++)=(unsigned char)(((l)>>32)&0xff), \
+ *((c)++)=(unsigned char)(((l)>>24)&0xff), \
+ *((c)++)=(unsigned char)(((l)>>16)&0xff), \
+ *((c)++)=(unsigned char)(((l)>> 8)&0xff), \
+ *((c)++)=(unsigned char)(((l) )&0xff))
+
/* u32toLE serialises an unsigned, 32-bit number (n) as four bytes at (p) in
* little-endian order. The value of p is advanced by four. */
#define u32toLE(n, p) \
diff --git a/lib/libssl/ssl_locl.h b/lib/libssl/ssl_locl.h
index f5f7a8348e8..e557c2e9fc5 100644
--- a/lib/libssl/ssl_locl.h
+++ b/lib/libssl/ssl_locl.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_locl.h,v 1.264 2020/02/06 17:35:22 jsing Exp $ */
+/* $OpenBSD: ssl_locl.h,v 1.265 2020/02/21 16:07:00 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -169,20 +169,6 @@ __BEGIN_HIDDEN_DECLS
#define CTASSERT(x) extern char _ctassert[(x) ? 1 : -1 ] \
__attribute__((__unused__))
-#define l2n(l,c) (*((c)++)=(unsigned char)(((l)>>24)&0xff), \
- *((c)++)=(unsigned char)(((l)>>16)&0xff), \
- *((c)++)=(unsigned char)(((l)>> 8)&0xff), \
- *((c)++)=(unsigned char)(((l) )&0xff))
-
-#define l2n8(l,c) (*((c)++)=(unsigned char)(((l)>>56)&0xff), \
- *((c)++)=(unsigned char)(((l)>>48)&0xff), \
- *((c)++)=(unsigned char)(((l)>>40)&0xff), \
- *((c)++)=(unsigned char)(((l)>>32)&0xff), \
- *((c)++)=(unsigned char)(((l)>>24)&0xff), \
- *((c)++)=(unsigned char)(((l)>>16)&0xff), \
- *((c)++)=(unsigned char)(((l)>> 8)&0xff), \
- *((c)++)=(unsigned char)(((l) )&0xff))
-
#define s2n(s,c) ((c[0]=(unsigned char)(((s)>> 8)&0xff), \
c[1]=(unsigned char)(((s) )&0xff)),c+=2)