diff options
author | djm <> | 2009-01-09 12:15:52 +0000 |
---|---|---|
committer | djm <> | 2009-01-09 12:15:52 +0000 |
commit | 23f8d96f0f508b8bef2602049feee9c44228d34c (patch) | |
tree | a2a7787bc00e8f6a29153b8c6d9eb5e8f73d6269 /src/lib/libcrypto/des | |
parent | 30562050421d947c3eb3c10edde6e87730b17471 (diff) | |
download | openbsd-23f8d96f0f508b8bef2602049feee9c44228d34c.tar.gz openbsd-23f8d96f0f508b8bef2602049feee9c44228d34c.tar.bz2 openbsd-23f8d96f0f508b8bef2602049feee9c44228d34c.zip |
resolve conflicts
Diffstat (limited to 'src/lib/libcrypto/des')
-rw-r--r-- | src/lib/libcrypto/des/des_enc.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/des/ecb_enc.c | 47 | ||||
-rw-r--r-- | src/lib/libcrypto/des/enc_read.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/des/enc_writ.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/des/set_key.c | 9 |
5 files changed, 21 insertions, 47 deletions
diff --git a/src/lib/libcrypto/des/des_enc.c b/src/lib/libcrypto/des/des_enc.c index 0fe4e0b2ad..22701e0669 100644 --- a/src/lib/libcrypto/des/des_enc.c +++ b/src/lib/libcrypto/des/des_enc.c | |||
@@ -293,6 +293,8 @@ void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1, | |||
293 | 293 | ||
294 | #ifndef DES_DEFAULT_OPTIONS | 294 | #ifndef DES_DEFAULT_OPTIONS |
295 | 295 | ||
296 | #if !defined(OPENSSL_FIPS_DES_ASM) | ||
297 | |||
296 | #undef CBC_ENC_C__DONT_UPDATE_IV | 298 | #undef CBC_ENC_C__DONT_UPDATE_IV |
297 | #include "ncbc_enc.c" /* DES_ncbc_encrypt */ | 299 | #include "ncbc_enc.c" /* DES_ncbc_encrypt */ |
298 | 300 | ||
@@ -408,4 +410,6 @@ void DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output, | |||
408 | tin[0]=tin[1]=0; | 410 | tin[0]=tin[1]=0; |
409 | } | 411 | } |
410 | 412 | ||
413 | #endif | ||
414 | |||
411 | #endif /* DES_DEFAULT_OPTIONS */ | 415 | #endif /* DES_DEFAULT_OPTIONS */ |
diff --git a/src/lib/libcrypto/des/ecb_enc.c b/src/lib/libcrypto/des/ecb_enc.c index 00d5b91e8c..75ae6cf8bb 100644 --- a/src/lib/libcrypto/des/ecb_enc.c +++ b/src/lib/libcrypto/des/ecb_enc.c | |||
@@ -57,54 +57,7 @@ | |||
57 | */ | 57 | */ |
58 | 58 | ||
59 | #include "des_locl.h" | 59 | #include "des_locl.h" |
60 | #include "des_ver.h" | ||
61 | #include "spr.h" | 60 | #include "spr.h" |
62 | #include <openssl/opensslv.h> | ||
63 | #include <openssl/bio.h> | ||
64 | |||
65 | OPENSSL_GLOBAL const char libdes_version[]="libdes" OPENSSL_VERSION_PTEXT; | ||
66 | OPENSSL_GLOBAL const char DES_version[]="DES" OPENSSL_VERSION_PTEXT; | ||
67 | |||
68 | const char *DES_options(void) | ||
69 | { | ||
70 | static int init=1; | ||
71 | static char buf[32]; | ||
72 | |||
73 | if (init) | ||
74 | { | ||
75 | const char *ptr,*unroll,*risc,*size; | ||
76 | |||
77 | #ifdef DES_PTR | ||
78 | ptr="ptr"; | ||
79 | #else | ||
80 | ptr="idx"; | ||
81 | #endif | ||
82 | #if defined(DES_RISC1) || defined(DES_RISC2) | ||
83 | #ifdef DES_RISC1 | ||
84 | risc="risc1"; | ||
85 | #endif | ||
86 | #ifdef DES_RISC2 | ||
87 | risc="risc2"; | ||
88 | #endif | ||
89 | #else | ||
90 | risc="cisc"; | ||
91 | #endif | ||
92 | #ifdef DES_UNROLL | ||
93 | unroll="16"; | ||
94 | #else | ||
95 | unroll="4"; | ||
96 | #endif | ||
97 | if (sizeof(DES_LONG) != sizeof(long)) | ||
98 | size="int"; | ||
99 | else | ||
100 | size="long"; | ||
101 | BIO_snprintf(buf,sizeof buf,"des(%s,%s,%s,%s)",ptr,risc,unroll, | ||
102 | size); | ||
103 | init=0; | ||
104 | } | ||
105 | return(buf); | ||
106 | } | ||
107 | |||
108 | 61 | ||
109 | void DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output, | 62 | void DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output, |
110 | DES_key_schedule *ks, int enc) | 63 | DES_key_schedule *ks, int enc) |
diff --git a/src/lib/libcrypto/des/enc_read.c b/src/lib/libcrypto/des/enc_read.c index c70fb686b8..e7da2ec66b 100644 --- a/src/lib/libcrypto/des/enc_read.c +++ b/src/lib/libcrypto/des/enc_read.c | |||
@@ -147,7 +147,11 @@ int DES_enc_read(int fd, void *buf, int len, DES_key_schedule *sched, | |||
147 | /* first - get the length */ | 147 | /* first - get the length */ |
148 | while (net_num < HDRSIZE) | 148 | while (net_num < HDRSIZE) |
149 | { | 149 | { |
150 | #ifndef _WIN32 | ||
150 | i=read(fd,(void *)&(net[net_num]),HDRSIZE-net_num); | 151 | i=read(fd,(void *)&(net[net_num]),HDRSIZE-net_num); |
152 | #else | ||
153 | i=_read(fd,(void *)&(net[net_num]),HDRSIZE-net_num); | ||
154 | #endif | ||
151 | #ifdef EINTR | 155 | #ifdef EINTR |
152 | if ((i == -1) && (errno == EINTR)) continue; | 156 | if ((i == -1) && (errno == EINTR)) continue; |
153 | #endif | 157 | #endif |
diff --git a/src/lib/libcrypto/des/enc_writ.c b/src/lib/libcrypto/des/enc_writ.c index af5b8c2349..c2f032c9a6 100644 --- a/src/lib/libcrypto/des/enc_writ.c +++ b/src/lib/libcrypto/des/enc_writ.c | |||
@@ -153,7 +153,11 @@ int DES_enc_write(int fd, const void *_buf, int len, | |||
153 | { | 153 | { |
154 | /* eay 26/08/92 I was not doing writing from where we | 154 | /* eay 26/08/92 I was not doing writing from where we |
155 | * got up to. */ | 155 | * got up to. */ |
156 | #ifndef _WIN32 | ||
156 | i=write(fd,(void *)&(outbuf[j]),outnum-j); | 157 | i=write(fd,(void *)&(outbuf[j]),outnum-j); |
158 | #else | ||
159 | i=_write(fd,(void *)&(outbuf[j]),outnum-j); | ||
160 | #endif | ||
157 | if (i == -1) | 161 | if (i == -1) |
158 | { | 162 | { |
159 | #ifdef EINTR | 163 | #ifdef EINTR |
diff --git a/src/lib/libcrypto/des/set_key.c b/src/lib/libcrypto/des/set_key.c index a43ef3c881..c0806d593c 100644 --- a/src/lib/libcrypto/des/set_key.c +++ b/src/lib/libcrypto/des/set_key.c | |||
@@ -64,6 +64,10 @@ | |||
64 | * 1.0 First working version | 64 | * 1.0 First working version |
65 | */ | 65 | */ |
66 | #include "des_locl.h" | 66 | #include "des_locl.h" |
67 | #ifdef OPENSSL_FIPS | ||
68 | #include <openssl/fips.h> | ||
69 | #endif | ||
70 | |||
67 | 71 | ||
68 | OPENSSL_IMPLEMENT_GLOBAL(int,DES_check_key); /* defaults to false */ | 72 | OPENSSL_IMPLEMENT_GLOBAL(int,DES_check_key); /* defaults to false */ |
69 | 73 | ||
@@ -349,6 +353,10 @@ void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule) | |||
349 | k = &schedule->ks->deslong[0]; | 353 | k = &schedule->ks->deslong[0]; |
350 | in = &(*key)[0]; | 354 | in = &(*key)[0]; |
351 | 355 | ||
356 | #ifdef OPENSSL_FIPS | ||
357 | FIPS_selftest_check(); | ||
358 | #endif | ||
359 | |||
352 | c2l(in,c); | 360 | c2l(in,c); |
353 | c2l(in,d); | 361 | c2l(in,d); |
354 | 362 | ||
@@ -405,3 +413,4 @@ void des_fixup_key_parity(des_cblock *key) | |||
405 | des_set_odd_parity(key); | 413 | des_set_odd_parity(key); |
406 | } | 414 | } |
407 | */ | 415 | */ |
416 | |||