* https://www.openssl.org/source/license.html
*/
+#include <assert.h>
#include "../ssl_locl.h"
#include "record_locl.h"
unsigned char *seq;
int lenu, lenf;
SSL3_RECORD *rec = &recs[0];
- uint32_t alg_enc = s->s3->tmp.new_cipher->algorithm_enc;
+ uint32_t alg_enc;
if (n_recs != 1) {
/* Should not happen */
rec->input = rec->data;
return 1;
}
+
ivlen = EVP_CIPHER_CTX_iv_length(ctx);
+ /*
+ * To get here we must have selected a ciphersuite - otherwise ctx would
+ * be NULL
+ */
+ assert(s->s3->tmp.new_cipher != NULL);
+ if (s->s3->tmp.new_cipher == NULL)
+ return -1;
+ alg_enc = s->s3->tmp.new_cipher->algorithm_enc;
+
if (alg_enc & SSL_AESCCM) {
if (alg_enc & (SSL_AES128CCM8 | SSL_AES256CCM8))
taglen = EVP_CCM8_TLS_TAG_LEN;