diff options
Diffstat (limited to 'demos')
-rw-r--r-- | demos/maurice/example1.c | 4 | ||||
-rw-r--r-- | demos/maurice/example3.c | 6 |
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); } |