diff options
| author | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-05-27 15:07:29 +0200 |
|---|---|---|
| committer | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-05-27 15:07:29 +0200 |
| commit | 672ebc3868997c44b83f7afe59e9b4d876135247 (patch) | |
| tree | f2a7a48dc1ff6c85e417767bfd237be331897423 /src/crypt/cryptclassevp.cpp | |
| parent | 220702c05e5c67817e5ba45765fd75ead8e92bb3 (diff) | |
| download | IT-Sicherheit-672ebc3868997c44b83f7afe59e9b4d876135247.tar.gz IT-Sicherheit-672ebc3868997c44b83f7afe59e9b4d876135247.zip | |
Add an AES implementation with openssl evp
Diffstat (limited to 'src/crypt/cryptclassevp.cpp')
| -rw-r--r-- | src/crypt/cryptclassevp.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/crypt/cryptclassevp.cpp b/src/crypt/cryptclassevp.cpp index 1ee09a0..7aec7b6 100644 --- a/src/crypt/cryptclassevp.cpp +++ b/src/crypt/cryptclassevp.cpp @@ -19,9 +19,9 @@ void CryptClassEvp::encrypt() EVP_CIPHER_CTX *ctx; - int len; + int len = 0; - int ciphertext_len; + int ciphertext_len = 0; /* Create and initialise the context */ if (!(ctx = EVP_CIPHER_CTX_new())) @@ -58,6 +58,7 @@ void CryptClassEvp::encrypt() ciphertext_len += len; + m_cryptText.resize(ciphertext_len); /* Clean up */ EVP_CIPHER_CTX_free(ctx); } @@ -104,7 +105,7 @@ void CryptClassEvp::decrypt() } plaintext_len += len; - + m_clearText.resize(plaintext_len); /* Clean up */ EVP_CIPHER_CTX_free(ctx); } |
