aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2001-10-17 00:37:12 +0000
committerDr. Stephen Henson <steve@openssl.org>2001-10-17 00:37:12 +0000
commit581f1c84940d77451c2592e9fa470893f6c3c3eb (patch)
tree33ebc8fc45b20aceff7589249bbc9a12282d543d /demos
parent41ebed27faa5e7b283313f97729a9f52746c1ac2 (diff)
downloadopenssl-581f1c84940d77451c2592e9fa470893f6c3c3eb.tar.gz
Modify EVP cipher behaviour in a similar way
to digests to retain compatibility.
Diffstat (limited to 'demos')
-rw-r--r--demos/maurice/example1.c4
-rw-r--r--demos/maurice/example3.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/demos/maurice/example1.c b/demos/maurice/example1.c
index 4890b69ce5..da2c6d31c5 100644
--- a/demos/maurice/example1.c
+++ b/demos/maurice/example1.c
@@ -126,7 +126,7 @@ void main_encrypt(void)
void main_decrypt(void)
{
- char buf[512];
+ char buf[520];
char ebuf[512];
unsigned int buflen;
EVP_CIPHER_CTX ectx;
@@ -164,7 +164,6 @@ void main_decrypt(void)
read(STDIN, encryptKey, ekeylen);
read(STDIN, iv, sizeof(iv));
-
EVP_OpenInit(&ectx,
EVP_des_ede3_cbc(),
encryptKey,
@@ -185,7 +184,6 @@ void main_decrypt(void)
}
EVP_OpenUpdate(&ectx, buf, &buflen, ebuf, readlen);
-
write(STDOUT, buf, buflen);
}
diff --git a/demos/maurice/example3.c b/demos/maurice/example3.c
index c8462a47c3..03d8a20f62 100644
--- a/demos/maurice/example3.c
+++ b/demos/maurice/example3.c
@@ -57,7 +57,8 @@ void do_cipher(char *pw, int operation)
EVP_BytesToKey(ALG, EVP_md5(), "salu", pw, strlen(pw), 1, key, iv);
- EVP_CipherInit(&ectx, ALG, key, iv, operation);
+ EVP_CIPHER_CTX_init(&ectx);
+ EVP_CipherInit_ex(&ectx, ALG, NULL, key, iv, operation);
while(1)
{
@@ -79,7 +80,8 @@ void do_cipher(char *pw, int operation)
write(STDOUT, ebuf, ebuflen);
}
- EVP_CipherFinal(&ectx, ebuf, &ebuflen);
+ EVP_CipherFinal_ex(&ectx, ebuf, &ebuflen);
+ EVP_CIPHER_CTX_cleanup(&ectx);
write(STDOUT, ebuf, ebuflen);
}