richter 01/09/06 23:51:29
Modified: crypto epcrypto.c
Added: crypto Makefile
Log:
source crypto
Revision Changes Path
1.2 +8 -18 embperl/crypto/epcrypto.c
Index: epcrypto.c
===================================================================
RCS file: /home/cvs/embperl/crypto/epcrypto.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- epcrypto.c 2001/09/04 19:24:13 1.1
+++ epcrypto.c 2001/09/07 06:51:29 1.2
@@ -20,7 +20,7 @@
EVP_CIPHER_CTX ctx ;
EVP_CipherInit(&ctx, EPC_CHIPER, NULL, NULL, do_encrypt);
- EVP_CIPHER_CTX_set_key_length(&ctx, EPC_KEYLEN);
+ //EVP_CIPHER_CTX_set_key_length(&ctx, EPC_KEYLEN);
EVP_CipherInit(&ctx, NULL, key, iv, do_encrypt);
@@ -28,18 +28,11 @@
{
inlen = fread(inbuf, 1, 1024, in);
if(inlen <= 0) break;
- if(!EVP_CipherUpdate(&ctx, outbuf, &outlen, inbuf, inlen))
- {
-
- return 0;
- }
+ EVP_CipherUpdate(&ctx, outbuf, &outlen, inbuf, inlen) ;
fwrite(outbuf, 1, outlen, out);
}
if(!EVP_CipherFinal(&ctx, outbuf, &outlen))
- {
-
return 0;
- }
fwrite(outbuf, 1, outlen, out);
EVP_CIPHER_CTX_cleanup(&ctx);
@@ -65,17 +58,14 @@
if (type > 0)
{
EVP_CipherInit(&ctx, EPC_CHIPER, NULL, NULL, do_encrypt);
- EVP_CIPHER_CTX_set_key_length(&ctx, EPC_KEYLEN);
+ //EVP_CIPHER_CTX_set_key_length(&ctx, EPC_KEYLEN);
EVP_CipherInit(&ctx, NULL, key, iv, do_encrypt);
}
if (type < 2)
{
- if(!EVP_CipherUpdate(&ctx, outbuf, &outlen, inbuf, inlen))
- {
- return 0;
- }
+ EVP_CipherUpdate(&ctx, outbuf, &outlen, inbuf, inlen) ;
}
else
{
@@ -101,13 +91,13 @@
puts ("Embperl encryption tool / Vers. 1.0 / (c) 2001 G.Richter ecos gmbh\n") ;
- OpenSSL_add_all_algorithums () ;
+ //OpenSSL_add_all_algorithums () ;
if (argc < 3)
{
- puts ("Usage: epcrypto <inputfile> <outputfile> [<syntax>] [<decrypt>]\n") ;
- puts (" syntax defaults to 'Embperl'\n") ;
- puts (" decrypt defaults to false\n") ;
+ puts ("Usage: epcrypto <inputfile> <outputfile> [<syntax>] [<decrypt>]") ;
+ puts (" syntax defaults to 'Embperl'") ;
+ puts (" decrypt defaults to false") ;
exit (1) ;
}
1.1 embperl/crypto/Makefile
Index: Makefile
===================================================================
SSL_BASE=/usr/local/ssl
epcrypto: epcrypto.c epcrypto_config.h
gcc -Wall -I$(SSL_BASE)/include -L$(SSL_BASE)/lib -o epcrypto epcrypto.c
-lcrypto
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]