}
*outl = inl;
+ /*
+ * Remove any TLS padding. Only used by cipher_aes_cbc_hmac_sha1_hw.c and
+ * cipher_aes_cbc_hmac_sha256_hw.c
+ */
+ if (!ctx->enc && ctx->removetlspad > 0) {
+ /* The actual padding length */
+ *outl -= out[inl - 1] + 1;
+
+ /* MAC and explicit IV */
+ *outl -= ctx->removetlspad;
+ }
+
return 1;
}
int cipher_generic_stream_final(void *vctx, unsigned char *out, size_t *outl,
* points into the user buffer.
*/
size_t tlsmacsize; /* Size of the TLS MAC */
+ size_t removetlspad; /*
+ * Length of the fixed size data to remove when
+ * removing TLS padding (equals mac size plus
+ * IV size if applicable)
+ */
/*
* num contains the number of bytes of |iv| which are valid for modes that