]> www.wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - test_digest.c
Fix gcc13 error: writing 1 byte into a region of size 0
[openssl-gost/engine.git] / test_digest.c
index f3d4169555daecc61b420800df6fe35fb5a98960..68c0e3253f7366cea9d8525dd7199821d92d7093 100644 (file)
@@ -7,6 +7,11 @@
  * See https://www.openssl.org/source/license.html for details
  */
 
+#ifdef _MSC_VER
+# pragma warning(push, 3)
+# include <openssl/applink.c>
+# pragma warning(pop)
+#endif
 #include <openssl/opensslv.h>
 #include <openssl/engine.h>
 #include <openssl/provider.h>
@@ -182,7 +187,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 +640,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 +696,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;