diff options
| author | jsing <> | 2020-02-21 16:07:00 +0000 |
|---|---|---|
| committer | jsing <> | 2020-02-21 16:07:00 +0000 |
| commit | e173811f7a345de2b1fc719064b6ec1ca1eed9c6 (patch) | |
| tree | a13678b1a92e77c3f4055a2ceb7e1a2de01aa28a /src/lib/libssl/s3_cbc.c | |
| parent | 7c5f5fa6aea2d2a9019070464bd2b2d6429b4a85 (diff) | |
| download | openbsd-e173811f7a345de2b1fc719064b6ec1ca1eed9c6.tar.gz openbsd-e173811f7a345de2b1fc719064b6ec1ca1eed9c6.tar.bz2 openbsd-e173811f7a345de2b1fc719064b6ec1ca1eed9c6.zip | |
Move l2n/l2n8 into s3_cbc.c, since this is the only code that uses it.
ok inoguchi@ tb@
Diffstat (limited to 'src/lib/libssl/s3_cbc.c')
| -rw-r--r-- | src/lib/libssl/s3_cbc.c | 16 |
1 files changed, 15 insertions, 1 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) \ |
