summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/sha
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/sha')
-rw-r--r--src/lib/libcrypto/sha/asm/sha1-586.pl2
-rw-r--r--src/lib/libcrypto/sha/sha.h7
-rw-r--r--src/lib/libcrypto/sha/sha1dgst.c8
-rw-r--r--src/lib/libcrypto/sha/sha_locl.h9
-rw-r--r--src/lib/libcrypto/sha/shatest.c4
5 files changed, 27 insertions, 3 deletions
diff --git a/src/lib/libcrypto/sha/asm/sha1-586.pl b/src/lib/libcrypto/sha/asm/sha1-586.pl
index e00f709553..041acc0348 100644
--- a/src/lib/libcrypto/sha/asm/sha1-586.pl
+++ b/src/lib/libcrypto/sha/asm/sha1-586.pl
@@ -405,7 +405,7 @@ sub sha1_block_data
405 &mov(&DWP(16,$tmp1,"",0),$E); 405 &mov(&DWP(16,$tmp1,"",0),$E);
406 &cmp("esi","eax"); 406 &cmp("esi","eax");
407 &mov(&DWP( 4,$tmp1,"",0),$B); 407 &mov(&DWP( 4,$tmp1,"",0),$B);
408 &jl(&label("start")); 408 &jb(&label("start"));
409 409
410 &stack_pop(18+9); 410 &stack_pop(18+9);
411 &pop("edi"); 411 &pop("edi");
diff --git a/src/lib/libcrypto/sha/sha.h b/src/lib/libcrypto/sha/sha.h
index 3fd54a10cc..79c07b0fd1 100644
--- a/src/lib/libcrypto/sha/sha.h
+++ b/src/lib/libcrypto/sha/sha.h
@@ -69,6 +69,10 @@ extern "C" {
69#error SHA is disabled. 69#error SHA is disabled.
70#endif 70#endif
71 71
72#if defined(OPENSSL_FIPS)
73#define FIPS_SHA_SIZE_T unsigned long
74#endif
75
72/* 76/*
73 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 77 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
74 * ! SHA_LONG has to be at least 32 bits wide. If it's wider, then ! 78 * ! SHA_LONG has to be at least 32 bits wide. If it's wider, then !
@@ -101,6 +105,9 @@ typedef struct SHAstate_st
101 } SHA_CTX; 105 } SHA_CTX;
102 106
103#ifndef OPENSSL_NO_SHA0 107#ifndef OPENSSL_NO_SHA0
108#ifdef OPENSSL_FIPS
109int private_SHA_Init(SHA_CTX *c);
110#endif
104int SHA_Init(SHA_CTX *c); 111int SHA_Init(SHA_CTX *c);
105int SHA_Update(SHA_CTX *c, const void *data, unsigned long len); 112int SHA_Update(SHA_CTX *c, const void *data, unsigned long len);
106int SHA_Final(unsigned char *md, SHA_CTX *c); 113int SHA_Final(unsigned char *md, SHA_CTX *c);
diff --git a/src/lib/libcrypto/sha/sha1dgst.c b/src/lib/libcrypto/sha/sha1dgst.c
index 182f65982a..1e2009b760 100644
--- a/src/lib/libcrypto/sha/sha1dgst.c
+++ b/src/lib/libcrypto/sha/sha1dgst.c
@@ -62,12 +62,20 @@
62#define SHA_1 62#define SHA_1
63 63
64#include <openssl/opensslv.h> 64#include <openssl/opensslv.h>
65#include <openssl/opensslconf.h>
65 66
67#ifndef OPENSSL_FIPS
66const char *SHA1_version="SHA1" OPENSSL_VERSION_PTEXT; 68const char *SHA1_version="SHA1" OPENSSL_VERSION_PTEXT;
67 69
68/* The implementation is in ../md32_common.h */ 70/* The implementation is in ../md32_common.h */
69 71
70#include "sha_locl.h" 72#include "sha_locl.h"
71 73
74#else /* ndef OPENSSL_FIPS */
75
76static void *dummy=&dummy;
77
78#endif /* ndef OPENSSL_FIPS */
79
72#endif 80#endif
73 81
diff --git a/src/lib/libcrypto/sha/sha_locl.h b/src/lib/libcrypto/sha/sha_locl.h
index 2dd63a62a6..a3623f72da 100644
--- a/src/lib/libcrypto/sha/sha_locl.h
+++ b/src/lib/libcrypto/sha/sha_locl.h
@@ -121,6 +121,11 @@
121# define sha1_block_data_order sha1_block_asm_data_order 121# define sha1_block_data_order sha1_block_asm_data_order
122# define DONT_IMPLEMENT_BLOCK_DATA_ORDER 122# define DONT_IMPLEMENT_BLOCK_DATA_ORDER
123# define HASH_BLOCK_DATA_ORDER_ALIGNED sha1_block_asm_data_order 123# define HASH_BLOCK_DATA_ORDER_ALIGNED sha1_block_asm_data_order
124# elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
125# define sha1_block_host_order sha1_block_asm_host_order
126# define DONT_IMPLEMENT_BLOCK_HOST_ORDER
127# define sha1_block_data_order sha1_block_asm_data_order
128# define DONT_IMPLEMENT_BLOCK_DATA_ORDER
124# endif 129# endif
125# endif 130# endif
126 void sha1_block_host_order (SHA_CTX *c, const void *p,int num); 131 void sha1_block_host_order (SHA_CTX *c, const void *p,int num);
@@ -138,7 +143,11 @@
138#define INIT_DATA_h3 0x10325476UL 143#define INIT_DATA_h3 0x10325476UL
139#define INIT_DATA_h4 0xc3d2e1f0UL 144#define INIT_DATA_h4 0xc3d2e1f0UL
140 145
146#if defined(SHA_0) && defined(OPENSSL_FIPS)
147FIPS_NON_FIPS_MD_Init(SHA)
148#else
141int HASH_INIT (SHA_CTX *c) 149int HASH_INIT (SHA_CTX *c)
150#endif
142 { 151 {
143 c->h0=INIT_DATA_h0; 152 c->h0=INIT_DATA_h0;
144 c->h1=INIT_DATA_h1; 153 c->h1=INIT_DATA_h1;
diff --git a/src/lib/libcrypto/sha/shatest.c b/src/lib/libcrypto/sha/shatest.c
index 5d2b1d3b1a..ff702aa53e 100644
--- a/src/lib/libcrypto/sha/shatest.c
+++ b/src/lib/libcrypto/sha/shatest.c
@@ -62,10 +62,10 @@
62 62
63#include "../e_os.h" 63#include "../e_os.h"
64 64
65#ifdef OPENSSL_NO_SHA 65#if defined(OPENSSL_NO_SHA) || defined(OPENSSL_NO_SHA0)
66int main(int argc, char *argv[]) 66int main(int argc, char *argv[])
67{ 67{
68 printf("No SHA support\n"); 68 printf("No SHA0 support\n");
69 return(0); 69 return(0);
70} 70}
71#else 71#else