Print this page
3364 dboot should check boot archive integrity
Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
Reviewed by: Dan McDonald <danmcd@nexenta.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Reviewed by: Garrett D'Amore <garrett@damore.org>

Split Close
Expand all
Collapse all
          --- old/usr/src/common/crypto/sha1/sha1.c
          +++ new/usr/src/common/crypto/sha1/sha1.c
↓ open down ↓ 24 lines elided ↑ open up ↑
  25   25   *
  26   26   * These notices must be retained in any copies of any part of this
  27   27   * documentation and/or software.
  28   28   *
  29   29   * NOTE: Cleaned-up and optimized, version of SHA1, based on the FIPS 180-1
  30   30   * standard, available at http://www.itl.nist.gov/fipspubs/fip180-1.htm
  31   31   * Not as fast as one would like -- further optimizations are encouraged
  32   32   * and appreciated.
  33   33   */
  34   34  
  35      -#ifndef _KERNEL
       35 +#if !defined(_KERNEL) && !defined(_BOOT)
  36   36  #include <stdint.h>
  37   37  #include <strings.h>
  38   38  #include <stdlib.h>
  39   39  #include <errno.h>
  40   40  #include <sys/systeminfo.h>
  41      -#endif  /* !_KERNEL */
       41 +#endif  /* !_KERNEL && !_BOOT */
  42   42  
  43   43  #include <sys/types.h>
  44   44  #include <sys/param.h>
  45   45  #include <sys/systm.h>
  46   46  #include <sys/sysmacros.h>
  47   47  #include <sys/sha1.h>
  48   48  #include <sys/sha1_consts.h>
  49   49  
  50   50  #ifdef _LITTLE_ENDIAN
  51   51  #include <sys/byteorder.h>
  52   52  #define HAVE_HTONL
  53   53  #endif
  54   54  
       55 +#ifdef  _BOOT
       56 +#define bcopy(_s, _d, _l)       ((void) memcpy((_d), (_s), (_l)))
       57 +#define bzero(_m, _l)           ((void) memset((_m), 0, (_l)))
       58 +#endif
       59 +
  55   60  static void Encode(uint8_t *, const uint32_t *, size_t);
  56   61  
  57   62  #if     defined(__sparc)
  58   63  
  59   64  #define SHA1_TRANSFORM(ctx, in) \
  60   65          SHA1Transform((ctx)->state[0], (ctx)->state[1], (ctx)->state[2], \
  61   66                  (ctx)->state[3], (ctx)->state[4], (ctx), (in))
  62   67  
  63   68  static void SHA1Transform(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t,
  64   69      SHA1_CTX *, const uint8_t *);
↓ open down ↓ 966 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX