projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dest4-sparcv9.pl: add clarification comment.
[oweals/openssl.git]
/
crypto
/
des
/
fcrypt.c
diff --git
a/crypto/des/fcrypt.c
b/crypto/des/fcrypt.c
index 1d619316fd4c0fc7c2ba7092369e1fcadf4777b2..de0a528640de54f737b1bfa54b85645032fb3edf 100644
(file)
--- a/
crypto/des/fcrypt.c
+++ b/
crypto/des/fcrypt.c
@@
-22,12
+22,14
@@
* defined 24.
*/
* defined 24.
*/
+#include <openssl/crypto.h>
#include "des_locl.h"
/* Added more values to handle illegal salt values the way normal
* crypt() implementations do. The patch was sent by
* Bjorn Gronvall <bg@sics.se>
*/
#include "des_locl.h"
/* Added more values to handle illegal salt values the way normal
* crypt() implementations do. The patch was sent by
* Bjorn Gronvall <bg@sics.se>
*/
+__fips_constseg
static unsigned const char con_salt[128]={
0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,
0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,0xE0,0xE1,
static unsigned const char con_salt[128]={
0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,
0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,0xE0,0xE1,
@@
-47,6
+49,7
@@
static unsigned const char con_salt[128]={
0x3D,0x3E,0x3F,0x40,0x41,0x42,0x43,0x44,
};
0x3D,0x3E,0x3F,0x40,0x41,0x42,0x43,0x44,
};
+__fips_constseg
static unsigned const char cov_2char[64]={
0x2E,0x2F,0x30,0x31,0x32,0x33,0x34,0x35,
0x36,0x37,0x38,0x39,0x41,0x42,0x43,0x44,
static unsigned const char cov_2char[64]={
0x2E,0x2F,0x30,0x31,0x32,0x33,0x34,0x35,
0x36,0x37,0x38,0x39,0x41,0x42,0x43,0x44,
@@
-58,22
+61,12
@@
static unsigned const char cov_2char[64]={
0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A
};
0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A
};
-void fcrypt_body(DES_LONG *out,des_key_schedule ks,
- DES_LONG Eswap0, DES_LONG Eswap1);
-
-#if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT)
-char *crypt(const char *buf, const char *salt)
- {
- return(des_crypt(buf, salt));
- }
-#endif
-
-char *des_crypt(const char *buf, const char *salt)
+char *DES_crypt(const char *buf, const char *salt)
{
static char buff[14];
#ifndef CHARSET_EBCDIC
{
static char buff[14];
#ifndef CHARSET_EBCDIC
- return(
des
_fcrypt(buf,salt,buff));
+ return(
DES
_fcrypt(buf,salt,buff));
#else
char e_salt[2+1];
char e_buf[32+1]; /* replace 32 by 8 ? */
#else
char e_salt[2+1];
char e_buf[32+1]; /* replace 32 by 8 ? */
@@
-89,14
+82,14
@@
char *des_crypt(const char *buf, const char *salt)
/* Make sure we have a delimiter */
e_salt[sizeof(e_salt)-1] = e_buf[sizeof(e_buf)-1] = '\0';
/* Make sure we have a delimiter */
e_salt[sizeof(e_salt)-1] = e_buf[sizeof(e_buf)-1] = '\0';
- /* Convert the e_salt to ASCII, as that's what
des
_fcrypt works on */
+ /* Convert the e_salt to ASCII, as that's what
DES
_fcrypt works on */
ebcdic2ascii(e_salt, e_salt, sizeof e_salt);
/* Convert the cleartext password to ASCII */
ebcdic2ascii(e_buf, e_buf, sizeof e_buf);
/* Encrypt it (from/to ASCII) */
ebcdic2ascii(e_salt, e_salt, sizeof e_salt);
/* Convert the cleartext password to ASCII */
ebcdic2ascii(e_buf, e_buf, sizeof e_buf);
/* Encrypt it (from/to ASCII) */
- ret =
des
_fcrypt(e_buf,e_salt,buff);
+ ret =
DES
_fcrypt(e_buf,e_salt,buff);
/* Convert the result back to EBCDIC */
ascii2ebcdic(ret, ret, strlen(ret));
/* Convert the result back to EBCDIC */
ascii2ebcdic(ret, ret, strlen(ret));
@@
-106,13
+99,13
@@
char *des_crypt(const char *buf, const char *salt)
}
}
-char *
des
_fcrypt(const char *buf, const char *salt, char *ret)
+char *
DES
_fcrypt(const char *buf, const char *salt, char *ret)
{
unsigned int i,j,x,y;
DES_LONG Eswap0,Eswap1;
DES_LONG out[2],ll;
{
unsigned int i,j,x,y;
DES_LONG Eswap0,Eswap1;
DES_LONG out[2],ll;
-
des
_cblock key;
-
des
_key_schedule ks;
+
DES
_cblock key;
+
DES
_key_schedule ks;
unsigned char bb[9];
unsigned char *b=bb;
unsigned char c,u;
unsigned char bb[9];
unsigned char *b=bb;
unsigned char c,u;
@@
-150,8
+143,8
@@
r=(r+7)/8;
for (; i<8; i++)
key[i]=0;
for (; i<8; i++)
key[i]=0;
-
des_set_key_unchecked(&key,
ks);
- fcrypt_body(&(out[0]),ks,Eswap0,Eswap1);
+
DES_set_key_unchecked(&key,&
ks);
+ fcrypt_body(&(out[0]),
&
ks,Eswap0,Eswap1);
ll=out[0]; l2c(ll,b);
ll=out[1]; l2c(ll,b);
ll=out[0]; l2c(ll,b);
ll=out[1]; l2c(ll,b);