diff options
author | Jeff Walden <jwalden@mit.edu> | 2020-05-21 19:57:07 +0000 |
---|---|---|
committer | Jeff Walden <jwalden@mit.edu> | 2020-05-21 19:57:07 +0000 |
commit | bec633a17056d87a94b599344039e65f11833aa1 (patch) | |
tree | eec5d020fba82f56b07c0978cd850f65a717987f | |
parent | d3958bd308962270c85c99015bc860ec4aac745e (diff) | |
download | nss-hg-bec633a17056d87a94b599344039e65f11833aa1.tar.gz |
Bug 1639033 - Change +sftk_xcbc_mac_pad's block-size argument to be unsigned int to avoid sign-comparison warnings. r=kjacobs
Depends on D75842
Differential Revision: https://phabricator.services.mozilla.com/D75843
-rw-r--r-- | lib/softoken/pkcs11i.h | 2 | ||||
-rw-r--r-- | lib/softoken/sftkike.c | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/softoken/pkcs11i.h b/lib/softoken/pkcs11i.h index 06c6ada92..45e29e827 100644 --- a/lib/softoken/pkcs11i.h +++ b/lib/softoken/pkcs11i.h @@ -828,7 +828,7 @@ extern CK_RV sftk_aes_xcbc_new_keys(CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hKey, CK_OBJECT_HANDLE_PTR phKey, unsigned char *k2, unsigned char *k3); extern CK_RV sftk_xcbc_mac_pad(unsigned char *padBuf, unsigned int bufLen, - int blockSize, const unsigned char *k2, + unsigned int blockSize, const unsigned char *k2, const unsigned char *k3); extern SECStatus sftk_fips_IKE_PowerUpSelfTests(void); diff --git a/lib/softoken/sftkike.c b/lib/softoken/sftkike.c index 85a745dd0..42f1e36fe 100644 --- a/lib/softoken/sftkike.c +++ b/lib/softoken/sftkike.c @@ -189,10 +189,11 @@ fail: /* encode the final pad block of aes xcbc, padBuf is modified */ CK_RV -sftk_xcbc_mac_pad(unsigned char *padBuf, unsigned int bufLen, int blockSize, - const unsigned char *k2, const unsigned char *k3) +sftk_xcbc_mac_pad(unsigned char *padBuf, unsigned int bufLen, + unsigned int blockSize, const unsigned char *k2, + const unsigned char *k3) { - int i; + unsigned int i; if (bufLen == blockSize) { for (i = 0; i < blockSize; i++) { padBuf[i] ^= k2[i]; |