Compile pkcs7 and des apps.
This commit is contained in:
parent
cab161c85f
commit
27ad06a627
@ -15,6 +15,7 @@ MAKE= make -f Makefile.ssl
|
||||
MAKEDEPEND= $(TOP)/util/domd $(TOP)
|
||||
MAKEFILE= Makefile.ssl
|
||||
AR= ar r
|
||||
RANLIB= ranlib
|
||||
DES_ENC= des_enc.o fcrypt_b.o
|
||||
# or use
|
||||
#DES_ENC= dx86-elf.o yx86-elf.o
|
||||
|
@ -58,7 +58,7 @@
|
||||
|
||||
#include "des_locl.h"
|
||||
|
||||
/* HAS BUGS? DON'T USE - this is only present for use in des.c */
|
||||
/* HAS BUGS! DON'T USE - this is only present for use in des.c */
|
||||
void des_3cbc_encrypt(des_cblock *input, des_cblock *output, long length,
|
||||
des_key_schedule ks1, des_key_schedule ks2, des_cblock *iv1,
|
||||
des_cblock *iv2, int enc)
|
||||
@ -69,11 +69,14 @@ void des_3cbc_encrypt(des_cblock *input, des_cblock *output, long length,
|
||||
|
||||
if (enc == DES_ENCRYPT)
|
||||
{
|
||||
des_cbc_encrypt(input,output,length,ks1,iv1,enc);
|
||||
des_cbc_encrypt((unsigned char*)input,
|
||||
(unsigned char*)output,length,ks1,iv1,enc);
|
||||
if (length >= sizeof(des_cblock))
|
||||
memcpy(niv1,output[off],sizeof(des_cblock));
|
||||
des_cbc_encrypt(output,output,l8,ks2,iv1,!enc);
|
||||
des_cbc_encrypt(output,output,l8,ks1,iv2, enc);
|
||||
des_cbc_encrypt((unsigned char*)output,
|
||||
(unsigned char*)output,l8,ks2,iv1,!enc);
|
||||
des_cbc_encrypt((unsigned char*)output,
|
||||
(unsigned char*)output,l8,ks1,iv2,enc);
|
||||
if (length >= sizeof(des_cblock))
|
||||
memcpy(niv2,output[off],sizeof(des_cblock));
|
||||
}
|
||||
@ -81,11 +84,14 @@ void des_3cbc_encrypt(des_cblock *input, des_cblock *output, long length,
|
||||
{
|
||||
if (length >= sizeof(des_cblock))
|
||||
memcpy(niv2,input[off],sizeof(des_cblock));
|
||||
des_cbc_encrypt(input,output,l8,ks1,iv2,enc);
|
||||
des_cbc_encrypt(output,output,l8,ks2,iv1,!enc);
|
||||
des_cbc_encrypt((unsigned char*)input,
|
||||
(unsigned char*)output,l8,ks1,iv2,enc);
|
||||
des_cbc_encrypt((unsigned char*)output,
|
||||
(unsigned char*)output,l8,ks2,iv1,!enc);
|
||||
if (length >= sizeof(des_cblock))
|
||||
memcpy(niv1,output[off],sizeof(des_cblock));
|
||||
des_cbc_encrypt(output,output,length,ks1,iv1, enc);
|
||||
des_cbc_encrypt((unsigned char*)output,
|
||||
(unsigned char*)output,length,ks1,iv1,enc);
|
||||
}
|
||||
memcpy(*iv1,niv1,sizeof(des_cblock));
|
||||
memcpy(*iv2,niv2,sizeof(des_cblock));
|
||||
|
@ -121,9 +121,10 @@ char *argv[];
|
||||
}
|
||||
|
||||
if ((in=BIO_new_file(keyfile,"r")) == NULL) goto err;
|
||||
if ((x509=PEM_read_bio_X509(in,NULL,NULL)) == NULL) goto err;
|
||||
if ((x509=PEM_read_bio_X509(in,NULL,NULL,NULL)) == NULL) goto err;
|
||||
BIO_reset(in);
|
||||
if ((pkey=PEM_read_bio_PrivateKey(in,NULL,NULL)) == NULL) goto err;
|
||||
if ((pkey=PEM_read_bio_PrivateKey(in,NULL,NULL,NULL)) == NULL)
|
||||
goto err;
|
||||
BIO_free(in);
|
||||
|
||||
if (pp == NULL)
|
||||
@ -131,7 +132,7 @@ char *argv[];
|
||||
|
||||
|
||||
/* Load the PKCS7 object from a file */
|
||||
if ((p7=PEM_read_bio_PKCS7(data,NULL,NULL)) == NULL) goto err;
|
||||
if ((p7=PEM_read_bio_PKCS7(data,NULL,NULL,NULL)) == NULL) goto err;
|
||||
|
||||
|
||||
|
||||
|
@ -98,7 +98,8 @@ char *argv[];
|
||||
argc-=2;
|
||||
argv+=2;
|
||||
if (!(in=BIO_new_file(keyfile,"r"))) goto err;
|
||||
if (!(x509=PEM_read_bio_X509(in,NULL,NULL))) goto err;
|
||||
if (!(x509=PEM_read_bio_X509(in,NULL,NULL,NULL)))
|
||||
goto err;
|
||||
if(!recips) recips = sk_X509_new_null();
|
||||
sk_X509_push(recips, x509);
|
||||
BIO_free(in);
|
||||
|
@ -97,9 +97,9 @@ again:
|
||||
BIO_set_fp(data,stdin,BIO_NOCLOSE);
|
||||
|
||||
if ((in=BIO_new_file("server.pem","r")) == NULL) goto err;
|
||||
if ((x509=PEM_read_bio_X509(in,NULL,NULL)) == NULL) goto err;
|
||||
if ((x509=PEM_read_bio_X509(in,NULL,NULL,NULL)) == NULL) goto err;
|
||||
BIO_reset(in);
|
||||
if ((pkey=PEM_read_bio_PrivateKey(in,NULL,NULL)) == NULL) goto err;
|
||||
if ((pkey=PEM_read_bio_PrivateKey(in,NULL,NULL,NULL)) == NULL) goto err;
|
||||
BIO_free(in);
|
||||
|
||||
p7=PKCS7_new();
|
||||
|
@ -121,7 +121,7 @@ char *argv[];
|
||||
|
||||
|
||||
/* Load the PKCS7 object from a file */
|
||||
if ((p7=PEM_read_bio_PKCS7(data,NULL,NULL)) == NULL) goto err;
|
||||
if ((p7=PEM_read_bio_PKCS7(data,NULL,NULL,NULL)) == NULL) goto err;
|
||||
|
||||
/* This stuff is being setup for certificate verification.
|
||||
* When using SSL, it could be replaced with a
|
||||
|
@ -1850,3 +1850,7 @@ BIO_nwrite 1874
|
||||
X509_REQ_extension_nid 1875
|
||||
BIO_nread 1876
|
||||
X509_REQ_get_extesion_nids 1877
|
||||
BIO_nwrite0 1878
|
||||
X509_REQ_add_extensions_nid 1879
|
||||
BIO_nread0 1880
|
||||
X509_REQ_add_extensions 1881
|
||||
|
Loading…
x
Reference in New Issue
Block a user