projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0da0728
)
Fix sending empty SPTPS records.
author
Guus Sliepen
<guus@tinc-vpn.org>
Tue, 15 Oct 2013 12:09:42 +0000
(14:09 +0200)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Tue, 15 Oct 2013 12:09:42 +0000
(14:09 +0200)
src/openssl/cipher.c
patch
|
blob
|
history
diff --git
a/src/openssl/cipher.c
b/src/openssl/cipher.c
index
b01f526
..
5172d82
100644
(file)
--- a/
src/openssl/cipher.c
+++ b/
src/openssl/cipher.c
@@
-160,7
+160,7
@@
bool cipher_gcm_encrypt_start(cipher_t *cipher, const void *indata, size_t inlen
bool cipher_gcm_encrypt_finish(cipher_t *cipher, const void *indata, size_t inlen, void *outdata, size_t *outlen) {
int len = 0, pad = 0;
bool cipher_gcm_encrypt_finish(cipher_t *cipher, const void *indata, size_t inlen, void *outdata, size_t *outlen) {
int len = 0, pad = 0;
- if(
!(inlen &&
EVP_EncryptUpdate(&cipher->ctx, (unsigned char *)outdata, &len, (unsigned char *)indata, inlen))
+ if(
(inlen && !
EVP_EncryptUpdate(&cipher->ctx, (unsigned char *)outdata, &len, (unsigned char *)indata, inlen))
|| !EVP_EncryptFinal(&cipher->ctx, (unsigned char *)outdata + len, &pad)) {
logger(DEBUG_ALWAYS, LOG_ERR, "Error while encrypting: %s", ERR_error_string(ERR_get_error(), NULL));
return false;
|| !EVP_EncryptFinal(&cipher->ctx, (unsigned char *)outdata + len, &pad)) {
logger(DEBUG_ALWAYS, LOG_ERR, "Error while encrypting: %s", ERR_error_string(ERR_get_error(), NULL));
return false;