summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorHoria Geanta <horia.geanta@freescale.com>2013-12-03 14:55:57 (GMT)
committerJose Rivera <German.Rivera@freescale.com>2014-03-28 13:39:44 (GMT)
commitffa718c8660ab30a92f1dcf59bc7bf17c4d050cf (patch)
treeed6fb983e99b6281e419c640720f3566c393cbd7 /crypto
parent779126cf974e9703db04bfe03cb45d07a21b8f85 (diff)
downloadlinux-fsl-qoriq-ffa718c8660ab30a92f1dcf59bc7bf17c4d050cf.tar.xz
crypto: caam - fix tls1.0 decrypt for zero pre ICV length case
The tls1.0 decrypt crypto engine descriptor did not handle correctly the case when the ciphertext contained only the authentication tag and padding (i.e. pre ICV length is zero). While here, add a test vector in test manager for this case. Change-Id: Ic3b12f1f9581b992b49d73f335d2ec991d92f1ad Signed-off-by: Tudor Ambarus <tudor.ambarus@freescale.com> Signed-off-by: Horia Geanta <horia.geanta@freescale.com> Reviewed-on: http://git.am.freescale.net:8181/7063 Reviewed-by: Mircea Pop <mircea.pop@freescale.com> Reviewed-by: Cristian Stoica <cristian.stoica@freescale.com> Reviewed-by: Thomas Trefny <Tom.Trefny@freescale.com> Tested-by: Zhenhua Luo <zhenhua.luo@freescale.com> (cherry picked from commit 5c235b1ce4ad0b53e86fe157b4add7079934f614) Reviewed-on: http://git.am.freescale.net:8181/10377 Reviewed-by: Alexandru Porosanu <alexandru.porosanu@freescale.com> Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/testmgr.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/crypto/testmgr.h b/crypto/testmgr.h
index 93638c1..4522228 100644
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
@@ -113,7 +113,7 @@ static char zeroed_string[48];
* TLS1.0 synthetic test vectors
*/
#define TLS_ENC_TEST_VECTORS 2
-#define TLS_DEC_TEST_VECTORS 1
+#define TLS_DEC_TEST_VECTORS 2
static struct tls_testvec tls_enc_tv_template[] = {
{
@@ -193,6 +193,29 @@ static struct tls_testvec tls_dec_tv_template[] = {
.alen = 13,
.result = "Single block msg",
.rlen = 16,
+ }, {
+#ifdef __LITTLE_ENDIAN
+ .key = "\x08\x00" /* rta length */
+ "\x01\x00" /* rta type */
+#else
+ .key = "\x00\x08" /* rta length */
+ "\x00\x01" /* rta type */
+#endif
+ "\x00\x00\x00\x10" /* enc key length */
+ "authenticationkey20b"
+ "enckeyis16_bytes",
+ .klen = 8 + 20 + 16,
+ .iv = "iv0123456789abcd",
+ .input = "\x58\x2a\x11\xc\x86\x8e\x4b\x67"
+ "\x2d\x16\x26\x1a\xac\x4b\xe2\x1a"
+ "\xe9\x6a\xcc\x4d\x6f\x79\x8a\x45"
+ "\x1f\x4e\x27\xf2\xa7\x59\xb4\x5a",
+ .ilen = 20 + 12,
+ .assoc = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x00\x03\x01\x00\x20",
+ .alen = 13,
+ .result = "",
+ .rlen = 0,
}
};