summaryrefslogtreecommitdiff
path: root/lib/libcrypto/des
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2009-01-09 12:15:53 +0000
committerDamien Miller <djm@cvs.openbsd.org>2009-01-09 12:15:53 +0000
commit6d17bf8726d06249097f42aa5b8fb41c345eeab8 (patch)
tree791e92f5e63e9cfece89543fce77b515015ab96c /lib/libcrypto/des
parentd30d6ad00561d36a052e2a024020f6802756f04a (diff)
resolve conflicts
Diffstat (limited to 'lib/libcrypto/des')
-rw-r--r--lib/libcrypto/des/des_enc.c4
-rw-r--r--lib/libcrypto/des/ecb_enc.c47
-rw-r--r--lib/libcrypto/des/enc_read.c4
-rw-r--r--lib/libcrypto/des/enc_writ.c4
-rw-r--r--lib/libcrypto/des/set_key.c9
5 files changed, 21 insertions, 47 deletions
diff --git a/lib/libcrypto/des/des_enc.c b/lib/libcrypto/des/des_enc.c
index 0fe4e0b2adc..22701e06693 100644
--- a/lib/libcrypto/des/des_enc.c
+++ b/lib/libcrypto/des/des_enc.c
@@ -293,6 +293,8 @@ void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1,
#ifndef DES_DEFAULT_OPTIONS
+#if !defined(OPENSSL_FIPS_DES_ASM)
+
#undef CBC_ENC_C__DONT_UPDATE_IV
#include "ncbc_enc.c" /* DES_ncbc_encrypt */
@@ -408,4 +410,6 @@ void DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output,
tin[0]=tin[1]=0;
}
+#endif
+
#endif /* DES_DEFAULT_OPTIONS */
diff --git a/lib/libcrypto/des/ecb_enc.c b/lib/libcrypto/des/ecb_enc.c
index 00d5b91e8ca..75ae6cf8bb6 100644
--- a/lib/libcrypto/des/ecb_enc.c
+++ b/lib/libcrypto/des/ecb_enc.c
@@ -57,54 +57,7 @@
*/
#include "des_locl.h"
-#include "des_ver.h"
#include "spr.h"
-#include <openssl/opensslv.h>
-#include <openssl/bio.h>
-
-OPENSSL_GLOBAL const char libdes_version[]="libdes" OPENSSL_VERSION_PTEXT;
-OPENSSL_GLOBAL const char DES_version[]="DES" OPENSSL_VERSION_PTEXT;
-
-const char *DES_options(void)
- {
- static int init=1;
- static char buf[32];
-
- if (init)
- {
- const char *ptr,*unroll,*risc,*size;
-
-#ifdef DES_PTR
- ptr="ptr";
-#else
- ptr="idx";
-#endif
-#if defined(DES_RISC1) || defined(DES_RISC2)
-#ifdef DES_RISC1
- risc="risc1";
-#endif
-#ifdef DES_RISC2
- risc="risc2";
-#endif
-#else
- risc="cisc";
-#endif
-#ifdef DES_UNROLL
- unroll="16";
-#else
- unroll="4";
-#endif
- if (sizeof(DES_LONG) != sizeof(long))
- size="int";
- else
- size="long";
- BIO_snprintf(buf,sizeof buf,"des(%s,%s,%s,%s)",ptr,risc,unroll,
- size);
- init=0;
- }
- return(buf);
- }
-
void DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output,
DES_key_schedule *ks, int enc)
diff --git a/lib/libcrypto/des/enc_read.c b/lib/libcrypto/des/enc_read.c
index c70fb686b8b..e7da2ec66b0 100644
--- a/lib/libcrypto/des/enc_read.c
+++ b/lib/libcrypto/des/enc_read.c
@@ -147,7 +147,11 @@ int DES_enc_read(int fd, void *buf, int len, DES_key_schedule *sched,
/* first - get the length */
while (net_num < HDRSIZE)
{
+#ifndef _WIN32
i=read(fd,(void *)&(net[net_num]),HDRSIZE-net_num);
+#else
+ i=_read(fd,(void *)&(net[net_num]),HDRSIZE-net_num);
+#endif
#ifdef EINTR
if ((i == -1) && (errno == EINTR)) continue;
#endif
diff --git a/lib/libcrypto/des/enc_writ.c b/lib/libcrypto/des/enc_writ.c
index af5b8c2349b..c2f032c9a6a 100644
--- a/lib/libcrypto/des/enc_writ.c
+++ b/lib/libcrypto/des/enc_writ.c
@@ -153,7 +153,11 @@ int DES_enc_write(int fd, const void *_buf, int len,
{
/* eay 26/08/92 I was not doing writing from where we
* got up to. */
+#ifndef _WIN32
i=write(fd,(void *)&(outbuf[j]),outnum-j);
+#else
+ i=_write(fd,(void *)&(outbuf[j]),outnum-j);
+#endif
if (i == -1)
{
#ifdef EINTR
diff --git a/lib/libcrypto/des/set_key.c b/lib/libcrypto/des/set_key.c
index a43ef3c8818..c0806d593c1 100644
--- a/lib/libcrypto/des/set_key.c
+++ b/lib/libcrypto/des/set_key.c
@@ -64,6 +64,10 @@
* 1.0 First working version
*/
#include "des_locl.h"
+#ifdef OPENSSL_FIPS
+#include <openssl/fips.h>
+#endif
+
OPENSSL_IMPLEMENT_GLOBAL(int,DES_check_key); /* defaults to false */
@@ -349,6 +353,10 @@ void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule)
k = &schedule->ks->deslong[0];
in = &(*key)[0];
+#ifdef OPENSSL_FIPS
+ FIPS_selftest_check();
+#endif
+
c2l(in,c);
c2l(in,d);
@@ -405,3 +413,4 @@ void des_fixup_key_parity(des_cblock *key)
des_set_odd_parity(key);
}
*/
+