summaryrefslogtreecommitdiff
path: root/main/openssl/ssl/s2_enc.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/openssl/ssl/s2_enc.c')
-rw-r--r--main/openssl/ssl/s2_enc.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/main/openssl/ssl/s2_enc.c b/main/openssl/ssl/s2_enc.c
index ff3395f4..a35968f6 100644
--- a/main/openssl/ssl/s2_enc.c
+++ b/main/openssl/ssl/s2_enc.c
@@ -117,8 +117,9 @@ err:
/* read/writes from s->s2->mac_data using length for encrypt and
* decrypt. It sets s->s2->padding and s->[rw]length
- * if we are encrypting */
-void ssl2_enc(SSL *s, int send)
+ * if we are encrypting
+ * Returns 0 on error and 1 on success */
+int ssl2_enc(SSL *s, int send)
{
EVP_CIPHER_CTX *ds;
unsigned long l;
@@ -136,7 +137,7 @@ void ssl2_enc(SSL *s, int send)
}
/* check for NULL cipher */
- if (ds == NULL) return;
+ if (ds == NULL) return 1;
bs=ds->cipher->block_size;
@@ -145,7 +146,10 @@ void ssl2_enc(SSL *s, int send)
if (bs == 8)
l=(l+7)/8*8;
- EVP_Cipher(ds,s->s2->mac_data,s->s2->mac_data,l);
+ if(EVP_Cipher(ds,s->s2->mac_data,s->s2->mac_data,l) < 1)
+ return 0;
+
+ return 1;
}
void ssl2_mac(SSL *s, unsigned char *md, int send)