aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitaly Chikunov <vt@altlinux.org>2021-12-04 10:25:38 +0300
committerDmitry Belyavskiy <beldmit@users.noreply.github.com>2021-12-11 19:45:14 +0300
commit141dc82447a18bc8660032216b9b42758c80d335 (patch)
tree6fb9708470396eb9db51c0ef59a575a05f999b56
parenta0d13491d28ee12e1c5517a0684a571be96fc7a5 (diff)
downloadgost-engine-141dc82447a18bc8660032216b9b42758c80d335.zip
gost-engine-141dc82447a18bc8660032216b9b42758c80d335.tar.gz
gost-engine-141dc82447a18bc8660032216b9b42758c80d335.tar.bz2
MSVC: Fix signed/unsigned mismatch errors
test_digest.c(513,2): warning C4389: '==': signed/unsigned mismatch test_digest.c(820,5): warning C4389: '==': signed/unsigned mismatch test_sign.c(241,22): warning C4389: '==': signed/unsigned mismatch test_params.c(1131,16): warning C4018: '<': signed/unsigned mismatch test_sign.c(241,22): warning C4389: '==': signed/unsigned mismatch Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
-rw-r--r--test_digest.c6
-rw-r--r--test_params.c2
-rw-r--r--test_sign.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/test_digest.c b/test_digest.c
index f3d4169..9b02198 100644
--- a/test_digest.c
+++ b/test_digest.c
@@ -182,7 +182,7 @@ struct hash_testvec {
const char *hmac; /* Expected output for HMAC tests. */
const char *key; /* MAC key.*/
int psize; /* Input (plaintext) size. */
- int outsize; /* Compare to EVP_MD_size() / EVP_MAC_size() if non-zero. */
+ size_t outsize; /* Compare to EVP_MD_size() / EVP_MAC_size() if non-zero. */
int truncate; /* Truncated output (digest) size. */
int key_size; /* MAC key size. */
int block_size; /* Internal block size. */
@@ -635,7 +635,7 @@ static int do_mac(int iter, EVP_MAC *mac, const char *plaintext,
const struct hash_testvec *t)
{
if (!iter)
- printf("[MAC %d] ", t->outsize);
+ printf("[MAC %zu] ", t->outsize);
size_t acpkm = (size_t)t->acpkm;
size_t acpkm_t = (size_t)t->acpkm_t;
@@ -691,7 +691,7 @@ static int do_digest(int iter, const EVP_MD *type, const char *plaintext,
const struct hash_testvec *t)
{
if (!iter)
- printf("[MD %d] ", t->outsize);
+ printf("[MD %zu] ", t->outsize);
if (t->outsize)
T(EVP_MD_size(type) == t->outsize);
size_t outsize;
diff --git a/test_params.c b/test_params.c
index 2808e26..e0947e2 100644
--- a/test_params.c
+++ b/test_params.c
@@ -1127,7 +1127,7 @@ static int test_param(struct test_param *t)
T(mdtype = EVP_get_digestbynid(hash_nid));
T(EVP_VerifyInit(md_ctx, mdtype));
/* Feed byte-by-byte. */
- int i;
+ size_t i;
for (i = 0; i < t->data_len; i++)
T(EVP_VerifyUpdate(md_ctx, &t->data[i], 1));
err = EVP_VerifyFinal(md_ctx, sig, siglen, pkey);
diff --git a/test_sign.c b/test_sign.c
index 4dd5d9b..e18acc1 100644
--- a/test_sign.c
+++ b/test_sign.c
@@ -47,7 +47,7 @@
struct test_sign {
const char *name;
- unsigned int nid;
+ int nid;
size_t bits;
const char *paramset;
};
@@ -239,7 +239,7 @@ static int test_sign(struct test_sign *t)
const EC_GROUP *group = EC_KEY_get0_group(ec);
int curve_name = EC_GROUP_get_curve_name(group);
err = curve_name == t->nid;
- printf("\tcurve_name (%u):\t", t->nid);
+ printf("\tcurve_name (%d):\t", t->nid);
print_test_tf(err, curve_name, "match", "mismatch");
ret |= !err;