diff options
author | Toomas Soome <tsoome@me.com> | 2017-07-04 19:44:42 +0300 |
---|---|---|
committer | Dan McDonald <danmcd@joyent.com> | 2018-12-07 16:34:34 -0500 |
commit | 03fe8ede397c5609aac1be54aedccec490dca121 (patch) | |
tree | b309ffba406a9c30d502d8c609f643d868127cfa | |
parent | a949e73d2676619263a21aaaaea30669bfcc27a1 (diff) | |
download | illumos-gate-03fe8ede397c5609aac1be54aedccec490dca121.tar.gz |
10026 common/sha1: update for loader build
Reviewed by: Gergő Mihály Doma <domag02@gmail.com>
Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r-- | usr/src/common/crypto/sha1/sha1.c | 15 | ||||
-rw-r--r-- | usr/src/uts/common/sys/sha1.h | 6 | ||||
-rw-r--r-- | usr/src/uts/common/sys/sha1_consts.h | 2 |
3 files changed, 17 insertions, 6 deletions
diff --git a/usr/src/common/crypto/sha1/sha1.c b/usr/src/common/crypto/sha1/sha1.c index 4a64eb2b8c..3c7100a65e 100644 --- a/usr/src/common/crypto/sha1/sha1.c +++ b/usr/src/common/crypto/sha1/sha1.c @@ -32,6 +32,10 @@ * and appreciated. */ +#if defined(_STANDALONE) +#include <sys/cdefs.h> +#define _RESTRICT_KYWD restrict +#else #if !defined(_KERNEL) && !defined(_BOOT) #include <stdint.h> #include <strings.h> @@ -39,6 +43,7 @@ #include <errno.h> #include <sys/systeminfo.h> #endif /* !_KERNEL && !_BOOT */ +#endif /* _STANDALONE */ #include <sys/types.h> #include <sys/param.h> @@ -47,10 +52,20 @@ #include <sys/sha1.h> #include <sys/sha1_consts.h> +#if defined(_STANDALONE) +#include <sys/endian.h> +#define HAVE_HTONL +#if _BYTE_ORDER == _LITTLE_ENDIAN +#undef _BIG_ENDIAN +#else +#undef _LITTLE_ENDIAN +#endif +#else #ifdef _LITTLE_ENDIAN #include <sys/byteorder.h> #define HAVE_HTONL #endif +#endif /* _STANDALONE */ #ifdef _BOOT #define bcopy(_s, _d, _l) ((void) memcpy((_d), (_s), (_l))) diff --git a/usr/src/uts/common/sys/sha1.h b/usr/src/uts/common/sys/sha1.h index 9265074b49..e74fe6d32c 100644 --- a/usr/src/uts/common/sys/sha1.h +++ b/usr/src/uts/common/sys/sha1.h @@ -26,8 +26,6 @@ #ifndef _SYS_SHA1_H #define _SYS_SHA1_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/types.h> /* for uint_* */ #ifdef __cplusplus @@ -41,10 +39,10 @@ extern "C" { * must be in a field declared as uint32_t state[5]. */ /* SHA-1 context. */ -typedef struct { +typedef struct { uint32_t state[5]; /* state (ABCDE) */ uint32_t count[2]; /* number of bits, modulo 2^64 (msb first) */ - union { + union { uint8_t buf8[64]; /* undigested input */ uint32_t buf32[16]; /* realigned input */ } buf_un; diff --git a/usr/src/uts/common/sys/sha1_consts.h b/usr/src/uts/common/sys/sha1_consts.h index 3a1491b86f..848d25ef05 100644 --- a/usr/src/uts/common/sys/sha1_consts.h +++ b/usr/src/uts/common/sys/sha1_consts.h @@ -27,8 +27,6 @@ #ifndef _SYS_SHA1_CONSTS_H #define _SYS_SHA1_CONSTS_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif |