Fix key wrapping mode with padding to conform to RFC 5649.
authorPetr Spacek <pspacek@redhat.com>
Mon, 26 Jan 2015 13:39:50 +0000 (14:39 +0100)
committerDr. Stephen Henson <steve@openssl.org>
Fri, 13 Mar 2015 14:18:59 +0000 (14:18 +0000)
commitffa75828dd13decb41d075576db676c81c1198f1
treec84e0e2cef31113bdb48582c9696eda75c0b9649
parentb5f07d6a66df963e45a5f7fe23329009b12bdf87
Fix key wrapping mode with padding to conform to RFC 5649.

According to RFC 5649 section 4.1 step 1) we should not add padding
if plaintext length is multiply of 8 ockets.

This matches pseudo-code in http://dx.doi.org/10.6028/NIST.SP.800-38F
on page 15, section 6.3 KWP, algorithm 5 KWP-AE, step 2.

PR#3675

Reviewed-by: Stephen Henson <steve@openssl.org>
Reviewed-by: Andy Polyakov <appro@openssl.org>
crypto/modes/wrap128.c