Releasing 1.1pre15.
[tinc] / src / openssl / cipher.c
index e362325..98033c5 100644 (file)
@@ -1,6 +1,6 @@
 /*
     cipher.c -- Symmetric block cipher handling
-    Copyright (C) 2007-2016 Guus Sliepen <guus@tinc-vpn.org>
+    Copyright (C) 2007-2017 Guus Sliepen <guus@tinc-vpn.org>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -137,7 +137,7 @@ bool cipher_encrypt(cipher_t *cipher, const void *indata, size_t inlen, void *ou
                int len, pad;
                if(EVP_EncryptInit_ex(cipher->ctx, NULL, NULL, NULL, NULL)
                                && EVP_EncryptUpdate(cipher->ctx, (unsigned char *)outdata, &len, indata, inlen)
-                               && EVP_EncryptFinal(cipher->ctx, (unsigned char *)outdata + len, &pad)) {
+                               && EVP_EncryptFinal_ex(cipher->ctx, (unsigned char *)outdata + len, &pad)) {
                        if(outlen) *outlen = len + pad;
                        return true;
                }
@@ -158,7 +158,7 @@ bool cipher_decrypt(cipher_t *cipher, const void *indata, size_t inlen, void *ou
                int len, pad;
                if(EVP_DecryptInit_ex(cipher->ctx, NULL, NULL, NULL, NULL)
                                && EVP_DecryptUpdate(cipher->ctx, (unsigned char *)outdata, &len, indata, inlen)
-                               && EVP_DecryptFinal(cipher->ctx, (unsigned char *)outdata + len, &pad)) {
+                               && EVP_DecryptFinal_ex(cipher->ctx, (unsigned char *)outdata + len, &pad)) {
                        if(outlen) *outlen = len + pad;
                        return true;
                }