]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
apps: Silence warnings on Win64 builds
authorTomas Mraz <tomas@openssl.org>
Tue, 17 Jun 2025 18:08:49 +0000 (20:08 +0200)
committerTomas Mraz <tomas@openssl.org>
Wed, 2 Jul 2025 15:26:26 +0000 (17:26 +0200)
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27806)

21 files changed:
apps/ca.c
apps/cmp.c
apps/dgst.c
apps/enc.c
apps/engine.c
apps/fipsinstall.c
apps/kdf.c
apps/list.c
apps/mac.c
apps/openssl.c
apps/passwd.c
apps/pkcs8.c
apps/pkeyutl.c
apps/prime.c
apps/req.c
apps/rsautl.c
apps/s_client.c
apps/s_server.c
apps/sess_id.c
apps/speed.c
apps/x509.c

index 6d1d1c0a6ea039385dc0d37fcd77f1a0c0402163..236b511de29f5705382f8543d6e371f8470a4d7c 100644 (file)
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -707,7 +707,7 @@ end_of_options:
             goto end;
         }
         p = pp[DB_serial];
-        j = strlen(p);
+        j = (int)strlen(p);
         if (*p == '-') {
             p++;
             j--;
@@ -2406,9 +2406,9 @@ static char *make_revocation_str(REVINFO_TYPE rev_type, const char *rev_arg)
     i = revtm->length + 1;
 
     if (reason)
-        i += strlen(reason) + 1;
+        i += (int)(strlen(reason) + 1);
     if (other)
-        i += strlen(other) + 1;
+        i += (int)(strlen(other) + 1);
 
     str = app_malloc(i, "revocation reason");
     OPENSSL_strlcpy(str, (char *)revtm->data, i);
index 2b4340d9fb45a89a87295f17afb61f82140be9ee..6f2fea4f5569e96a422faa6f933dc4459cce3b80 100644 (file)
@@ -1145,7 +1145,7 @@ static OSSL_CMP_SRV_CTX *setup_srv_ctx(ENGINE *engine)
         }
     } else {
         if (!OSSL_CMP_CTX_set1_referenceValue(ctx, (unsigned char *)opt_srv_ref,
-                                              strlen(opt_srv_ref)))
+                                              (int)strlen(opt_srv_ref)))
             goto err;
     }
 
@@ -1156,7 +1156,7 @@ static OSSL_CMP_SRV_CTX *setup_srv_ctx(ENGINE *engine)
         if (pass_str != NULL) {
             cleanse(opt_srv_secret);
             res = OSSL_CMP_CTX_set1_secretValue(ctx, (unsigned char *)pass_str,
-                                                strlen(pass_str));
+                                                (int)strlen(pass_str));
             clear_free(pass_str);
             if (res == 0)
                 goto err;
@@ -1550,7 +1550,7 @@ static int setup_protection_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
             cleanse(opt_secret);
             res = OSSL_CMP_CTX_set1_secretValue(ctx,
                                                 (unsigned char *)pass_string,
-                                                strlen(pass_string));
+                                                (int)strlen(pass_string));
             clear_free(pass_string);
             if (res == 0)
                 return 0;
@@ -1560,7 +1560,7 @@ static int setup_protection_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
     }
     if (opt_ref != NULL
             && !OSSL_CMP_CTX_set1_referenceValue(ctx, (unsigned char *)opt_ref,
-                                                 strlen(opt_ref)))
+                                                 (int)strlen(opt_ref)))
         return 0;
 
     if (opt_key != NULL) {
index 0fb1f45200a0e711a4a88b9aca10cd2bd2ed44a6..3257acd0c3bff130ca09e22ba6d26c2def648941 100644 (file)
@@ -576,7 +576,7 @@ static void print_out(BIO *out, unsigned char *buf, size_t len,
     int i, backslash = 0;
 
     if (binout) {
-        BIO_write(out, buf, len);
+        BIO_write(out, buf, (int)len);
     } else if (sep == 2) {
         file = newline_escape_filename(file, &backslash);
 
index cf26ac0a7d5adce3228a6db6766d2c4487bd6810..a3133aa25496f78f1d64363222ed3eb3e3d8cdb8 100644 (file)
@@ -582,7 +582,7 @@ int enc_main(int argc, char **argv)
                 /* not needed if HASH_UPDATE() is fixed : */
                 int islen = (sptr != NULL ? saltlen : 0);
 
-                if (!PKCS5_PBKDF2_HMAC(str, str_len, sptr, islen,
+                if (!PKCS5_PBKDF2_HMAC(str, (int)str_len, sptr, islen,
                                        iter, dgst, iklen+ivlen, tmpkeyiv)) {
                     BIO_printf(bio_err, "PKCS5_PBKDF2_HMAC failed\n");
                     goto end;
@@ -596,7 +596,7 @@ int enc_main(int argc, char **argv)
                                     "deprecated key derivation used.\n"
                                     "Using -iter or -pbkdf2 would be better.\n");
                 if (!EVP_BytesToKey(cipher, dgst, sptr,
-                                    (unsigned char *)str, str_len,
+                                    (unsigned char *)str, (int)str_len,
                                     1, key, iv)) {
                     BIO_printf(bio_err, "EVP_BytesToKey failed\n");
                     goto end;
@@ -825,7 +825,7 @@ static int set_hex(const char *in, unsigned char *out, int size)
     unsigned char j;
 
     i = size * 2;
-    n = strlen(in);
+    n = (int)strlen(in);
     if (n > i) {
         BIO_printf(bio_err, "hex string is too long, ignoring excess\n");
         n = i; /* ignore exceeding part */
index edd787514882153cc9788cb13b935bf30810eb2e..90e3e8be3fc033c3afd780cd0faf763f95842f96 100644 (file)
@@ -55,14 +55,14 @@ const OPTIONS engine_options[] = {
 static int append_buf(char **buf, int *size, const char *s)
 {
     const int expand = 256;
-    int len = strlen(s) + 1;
+    int len = (int)(strlen(s) + 1);
     char *p = *buf;
 
     if (p == NULL) {
         *size = ((len + expand - 1) / expand) * expand;
         p = *buf = app_malloc(*size, "engine buffer");
     } else {
-        const int blen = strlen(p);
+        const int blen = (int)strlen(p);
 
         if (blen > 0)
             len += 2 + blen;
index 0daa55a1b8aefddfe88d4d2690f573b31f815d81..1bece042e6e672b071ae7eb2e8eeb761f12f4b11 100644 (file)
@@ -853,7 +853,7 @@ int fipsinstall_main(int argc, char **argv)
 
     /* Calculate the MAC for the indicator status - it may not be used */
     mem_bio = BIO_new_mem_buf((const void *)INSTALL_STATUS_VAL,
-                              strlen(INSTALL_STATUS_VAL));
+                              (int)strlen(INSTALL_STATUS_VAL));
     if (mem_bio == NULL) {
         BIO_printf(bio_err, "Unable to create memory BIO\n");
         goto end;
index 89ee1f69c7669ff85263e0bd1a7f299103008ee9..8be5fed2a0e956d6957f133c8a1948a415730f75 100644 (file)
@@ -75,7 +75,7 @@ int kdf_main(int argc, char **argv)
     char *prog, *hexout = NULL;
     const char *outfile = NULL;
     unsigned char *dkm_bytes = NULL;
-    size_t dkm_len = 0;
+    int dkm_len = 0;
     BIO *out = NULL;
     EVP_KDF *kdf = NULL;
     EVP_KDF_CTX *ctx = NULL;
@@ -96,7 +96,7 @@ opthelp:
             out_bin = 1;
             break;
         case OPT_KEYLEN:
-            dkm_len = (size_t)atoi(opt_arg());
+            dkm_len = atoi(opt_arg());
             break;
         case OPT_OUT:
             outfile = opt_arg();
index 8421876fdd7fb8ab754bf933ece432b5f199d8d7..2aeedbbda8959c9f2fe4558ed72ef91c3613d214 100644 (file)
@@ -847,7 +847,7 @@ static void list_tls_groups(int version, int all)
 {
     SSL_CTX *ctx = NULL;
     STACK_OF(OPENSSL_CSTRING) *groups;
-    size_t i, num;
+    int i, num;
 
     if ((groups = sk_OPENSSL_CSTRING_new_null()) == NULL) {
         BIO_printf(bio_err, "ERROR: Memory allocation\n");
index 0a07b2ea4332968b9b86449111873d9118c6d1b8..eb835335fc12e287612f94725448ebe5fc3f0e7d 100644 (file)
@@ -212,7 +212,7 @@ opthelp:
     }
 
     if (out_bin) {
-        BIO_write(out, buf, len);
+        BIO_write(out, buf, (int)len);
     } else {
         for (i = 0; i < (int)len; ++i)
             BIO_printf(out, "%02X", buf[i]);
index f0f9a5cdcdd9bc36ad5d980c9bc30e8ca321aa5b..da0fc9db3ff420b486732c056af84d827d7ca4b0 100644 (file)
@@ -132,8 +132,10 @@ static size_t internal_trace_cb(const char *buf, size_t cnt,
             BIO_printf(bio_err, "ERROR: writing when tracing not started\n");
             return 0;
         }
+        if (cnt > INT_MAX)
+            cnt = INT_MAX;
 
-        ret = BIO_write(trace_data->bio, buf, cnt);
+        ret = BIO_write(trace_data->bio, buf, (int)cnt);
         break;
     case OSSL_TRACE_CTRL_END:
         if (!trace_data->ingroup) {
index 8b233538d87b49f38613d3d9ddb04b15a572b91d..e16f73473e5dcc2835e184e2779831fdb4b928fe 100644 (file)
@@ -241,7 +241,7 @@ int passwd_main(int argc, char **argv)
             passwds = passwds_static;
             if (in == NULL) {
                 if (EVP_read_pw_string
-                    (passwd_malloc, passwd_malloc_size, "Password: ",
+                    (passwd_malloc, (int)passwd_malloc_size, "Password: ",
                      !(passed_salt || in_noverify)) != 0)
                     goto end;
             }
@@ -269,7 +269,7 @@ int passwd_main(int argc, char **argv)
 
         assert(passwd != NULL);
         do {
-            int r = BIO_gets(in, passwd, pw_maxlen + 1);
+            int r = BIO_gets(in, passwd, (int)(pw_maxlen + 1));
             if (r > 0) {
                 char *c = (strchr(passwd, '\n'));
                 if (c != NULL) {
@@ -395,14 +395,14 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt)
         || !EVP_DigestFinal_ex(md2, buf, NULL))
         goto err;
 
-    for (i = passwd_len; i > sizeof(buf); i -= sizeof(buf)) {
+    for (i = (unsigned int)passwd_len; i > sizeof(buf); i -= sizeof(buf)) {
         if (!EVP_DigestUpdate(md, buf, sizeof(buf)))
             goto err;
     }
     if (!EVP_DigestUpdate(md, buf, i))
         goto err;
 
-    n = passwd_len;
+    n = (int)passwd_len;
     while (n) {
         if (!EVP_DigestUpdate(md, (n & 1) ? "\0" : passwd, 1))
             goto err;
@@ -797,7 +797,7 @@ static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
 
         if (*salt_malloc_p == NULL)
             *salt_p = *salt_malloc_p = app_malloc(saltlen + 1, "salt buffer");
-        if (RAND_bytes((unsigned char *)*salt_p, saltlen) <= 0)
+        if (RAND_bytes((unsigned char *)*salt_p, (int)saltlen) <= 0)
             goto end;
 
         for (i = 0; i < saltlen; i++)
index 22978afb9093e4e9d3a2c4569457d8c0ac041d64..407da0357c70d926e82fe4a82d09f38d7188a6be 100644 (file)
@@ -284,7 +284,7 @@ int pkcs8_main(int argc, char **argv)
                 BIO_printf(bio_err, "Password required\n");
                 goto end;
             }
-            p8 = PKCS8_set0_pbe(p8pass, strlen(p8pass), p8inf, pbe);
+            p8 = PKCS8_set0_pbe(p8pass, (int)strlen(p8pass), p8inf, pbe);
             if (p8 == NULL) {
                 X509_ALGOR_free(pbe);
                 BIO_printf(bio_err, "Error encrypting key\n");
@@ -344,7 +344,7 @@ int pkcs8_main(int argc, char **argv)
             BIO_printf(bio_err, "Password required\n");
             goto end;
         }
-        p8inf = PKCS8_decrypt(p8, p8pass, strlen(p8pass));
+        p8inf = PKCS8_decrypt(p8, p8pass, (int)strlen(p8pass));
     }
 
     if (p8inf == NULL) {
index 79ad4c6f29f5c05184080affd96d33ec58e969ff..900af11c38b5de49be3bd563986fb25c3334603b 100644 (file)
@@ -550,14 +550,14 @@ int pkeyutl_main(int argc, char **argv)
     if (rawin) {
         /* rawin allocates the buffer in do_raw_keyop() */
         rv = do_raw_keyop(pkey_op, mctx, pkey, in, filesize, NULL, 0,
-                          &buf_out, (size_t *)&buf_outlen);
+                          &buf_out, &buf_outlen);
     } else {
         if (kdflen != 0) {
             buf_outlen = kdflen;
             rv = 1;
         } else {
-            rv = do_keyop(ctx, pkey_op, NULL, (size_t *)&buf_outlen,
-                          buf_in, (size_t)buf_inlen, NULL, (size_t *)&secretlen);
+            rv = do_keyop(ctx, pkey_op, NULL, &buf_outlen,
+                          buf_in, (size_t)buf_inlen, NULL, &secretlen);
         }
         if (rv > 0
             && (secretlen > 0 || (pkey_op != EVP_PKEY_OP_ENCAPSULATE
@@ -568,8 +568,8 @@ int pkeyutl_main(int argc, char **argv)
             if (secretlen > 0)
                 secret = app_malloc(secretlen, "secret output");
             rv = do_keyop(ctx, pkey_op,
-                          buf_out, (size_t *)&buf_outlen,
-                          buf_in, (size_t)buf_inlen, secret, (size_t *)&secretlen);
+                          buf_out, &buf_outlen,
+                          buf_in, (size_t)buf_inlen, secret, &secretlen);
         }
     }
     if (rv <= 0) {
@@ -583,16 +583,16 @@ int pkeyutl_main(int argc, char **argv)
     ret = 0;
 
     if (asn1parse) {
-        if (!ASN1_parse_dump(out, buf_out, buf_outlen, 1, -1))
+        if (!ASN1_parse_dump(out, buf_out, (long)buf_outlen, 1, -1))
             ERR_print_errors(bio_err); /* but still return success */
     } else if (hexdump) {
-        BIO_dump(out, (char *)buf_out, buf_outlen);
+        BIO_dump(out, (char *)buf_out, (int)buf_outlen);
     } else {
-        BIO_write(out, buf_out, buf_outlen);
+        BIO_write(out, buf_out, (int)buf_outlen);
     }
     /* Backwards compatible decap output fallback */
     if (secretlen > 0)
-        BIO_write(secout ? secout : out, secret, secretlen);
+        BIO_write(secout ? secout : out, secret, (int)secretlen);
 
  end:
     if (ret != 0)
index fbc20ccb3116f39a6182493e67a5e50a38b788fd..8241c3eae01bbb40e8b676bdb9ddf972a404fdd1 100644 (file)
@@ -173,7 +173,6 @@ opthelp:
     } else {
         for ( ; *argv; argv++) {
             int bytes_read = 0;
-            int valid_digits_length = 0;
 
             if (!in_file) {
                 process_num(argv[0], hex);
@@ -185,6 +184,8 @@ opthelp:
                 }
 
                 while ((bytes_read = BIO_get_line(in, file_read_buf, BUFSIZE)) > 0) {
+                    size_t valid_digits_length;
+
                     /* Number is too long. Discard remainder of the line */
                     if (bytes_read == BUFSIZE - 1 && file_read_buf[BUFSIZE - 2] != '\n') {
                         BIO_printf(bio_err, "Value in %s is over the maximum size (%d digits)\n",
index c5627ffda54272da9f886450842f8eb0ad4f218e..d0368a76925e917c30819049672607952c521db0 100644 (file)
@@ -1418,7 +1418,7 @@ static int build_data(char *text, const char *def, char *value,
         return 1;
     }
 
-    i = strlen(buf);
+    i = (int)strlen(buf);
     if (buf[i - 1] != '\n') {
         BIO_printf(bio_err, "Missing newline at end of input\n");
         return 0;
@@ -1512,9 +1512,9 @@ static EVP_PKEY_CTX *set_keygen_ctx(const char *gstr,
         int len;
 
         if (p != NULL)
-            len = p - gstr;
+            len = (int)(p - gstr);
         else
-            len = strlen(gstr);
+            len = (int)strlen(gstr);
 
         if (strncmp(gstr, "param", len) == 0) {
             expect_paramfile = 1;
index 3ee8224f48d873efe4ad80dfc782f6136f79a2e1..c4720a674ebcf3ef170f42cf0af0a4316cafd4fe 100644 (file)
@@ -271,13 +271,13 @@ int rsautl_main(int argc, char **argv)
     }
     ret = 0;
     if (asn1parse) {
-        if (!ASN1_parse_dump(out, rsa_out, rsa_outlen, 1, -1)) {
+        if (!ASN1_parse_dump(out, rsa_out, (long)rsa_outlen, 1, -1)) {
             ERR_print_errors(bio_err);
         }
     } else if (hexdump) {
-        BIO_dump(out, (char *)rsa_out, rsa_outlen);
+        BIO_dump(out, (char *)rsa_out, (int)rsa_outlen);
     } else {
-        BIO_write(out, rsa_out, rsa_outlen);
+        BIO_write(out, rsa_out, (int)rsa_outlen);
     }
  end:
     EVP_PKEY_CTX_free(ctx);
index c2bda406b8fd421ead1372d490f80d4c3f75d746..dbef77ec03a652a81e396cca6fafccc8d534e44a 100644 (file)
@@ -311,7 +311,8 @@ static int next_proto_cb(SSL *s, unsigned char **out, unsigned char *outlen,
     }
 
     ctx->status =
-        SSL_select_next_proto(out, outlen, in, inlen, ctx->data, ctx->len);
+        SSL_select_next_proto(out, outlen, in, inlen,
+                              ctx->data, (unsigned int)ctx->len);
     return SSL_TLSEXT_ERR_OK;
 }
 #endif                         /* ndef OPENSSL_NO_NEXTPROTONEG */
@@ -333,7 +334,7 @@ static int serverinfo_cli_parse_cb(SSL *s, unsigned int ext_type,
 
     BIO_snprintf(pem_name, sizeof(pem_name), "SERVERINFO FOR EXTENSION %d",
                  ext_type);
-    PEM_write_bio(bio_c_out, pem_name, "", ext_buf, 4 + inlen);
+    PEM_write_bio(bio_c_out, pem_name, "", ext_buf, (long)(4 + inlen));
     return 1;
 }
 
@@ -1482,7 +1483,7 @@ int s_client_main(int argc, char **argv)
             break;
         case OPT_SERVERINFO:
             p = opt_arg();
-            len = strlen(p);
+            len = (int)strlen(p);
             for (start = 0, i = 0; i <= len; ++i) {
                 if (i == len || p[i] == ',') {
                     serverinfo_types[serverinfo_count] = atoi(p + start);
@@ -1965,7 +1966,7 @@ int s_client_main(int argc, char **argv)
             goto end;
         }
         /* Returns 0 on success! */
-        if (SSL_CTX_set_alpn_protos(ctx, alpn, alpn_len) != 0) {
+        if (SSL_CTX_set_alpn_protos(ctx, alpn, (unsigned int)alpn_len) != 0) {
             BIO_printf(bio_err, "Error setting ALPN\n");
             goto end;
         }
@@ -3687,7 +3688,7 @@ static int ldap_ExtendedResponse_parse(const char *buf, long rem)
     /* pull SEQUENCE */
     inf = ASN1_get_object(&cur, &len, &tag, &xclass, rem);
     if (inf != V_ASN1_CONSTRUCTED || tag != V_ASN1_SEQUENCE ||
-        (rem = end - cur, len > rem)) {
+        (rem = (long)(end - cur), len > rem)) {
         BIO_printf(bio_err, "Unexpected LDAP response\n");
         goto end;
     }
@@ -3697,7 +3698,7 @@ static int ldap_ExtendedResponse_parse(const char *buf, long rem)
     /* pull MessageID */
     inf = ASN1_get_object(&cur, &len, &tag, &xclass, rem);
     if (inf != V_ASN1_UNIVERSAL || tag != V_ASN1_INTEGER ||
-        (rem = end - cur, len > rem)) {
+        (rem = (long)(end - cur), len > rem)) {
         BIO_printf(bio_err, "No MessageID\n");
         goto end;
     }
@@ -3705,7 +3706,7 @@ static int ldap_ExtendedResponse_parse(const char *buf, long rem)
     cur += len; /* shall we check for MessageId match or just skip? */
 
     /* pull [APPLICATION 24] */
-    rem = end - cur;
+    rem = (long)(end - cur);
     inf = ASN1_get_object(&cur, &len, &tag, &xclass, rem);
     if (inf != V_ASN1_CONSTRUCTED || xclass != V_ASN1_APPLICATION ||
         tag != 24) {
@@ -3714,10 +3715,10 @@ static int ldap_ExtendedResponse_parse(const char *buf, long rem)
     }
 
     /* pull resultCode */
-    rem = end - cur;
+    rem = (long)(end - cur);
     inf = ASN1_get_object(&cur, &len, &tag, &xclass, rem);
     if (inf != V_ASN1_UNIVERSAL || tag != V_ASN1_ENUMERATED || len == 0 ||
-        (rem = end - cur, len > rem)) {
+        (rem = (long)(end - cur), len > rem)) {
         BIO_printf(bio_err, "Not LDAPResult\n");
         goto end;
     }
index 8a36122a25bf58fa2d31f48146e21f30f8cab961..13809de819868207e901f7ebbbf9a1cb1593d230 100644 (file)
@@ -660,7 +660,7 @@ static int next_proto_cb(SSL *s, const unsigned char **data,
     tlsextnextprotoctx *next_proto = arg;
 
     *data = next_proto->data;
-    *len = next_proto->len;
+    *len = (unsigned int)next_proto->len;
 
     return SSL_TLSEXT_ERR_OK;
 }
@@ -691,8 +691,8 @@ static int alpn_cb(SSL *s, const unsigned char **out, unsigned char *outlen,
     }
 
     if (SSL_select_next_proto
-        ((unsigned char **)out, outlen, alpn_ctx->data, alpn_ctx->len, in,
-         inlen) != OPENSSL_NPN_NEGOTIATED) {
+        ((unsigned char **)out, outlen, alpn_ctx->data,
+         (unsigned int)alpn_ctx->len, in, inlen) != OPENSSL_NPN_NEGOTIATED) {
         return SSL_TLSEXT_ERR_ALERT_FATAL;
     }
 
@@ -2476,7 +2476,7 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
 
     if (context != NULL
         && !SSL_set_session_id_context(con, context,
-                                       strlen((char *)context))) {
+                                       (unsigned int)strlen((char *)context))) {
         BIO_printf(bio_err, "Error setting session id context\n");
         ret = -1;
         goto err;
@@ -3205,7 +3205,7 @@ static int www_body(int s, int stype, int prot, unsigned char *context)
 
     if (context != NULL
         && !SSL_set_session_id_context(con, context,
-                                       strlen((char *)context))) {
+                                       (unsigned int)strlen((char *)context))) {
         SSL_free(con);
         goto err;
     }
@@ -3518,7 +3518,7 @@ static int www_body(int s, int stype, int prot, unsigned char *context)
                 BIO_printf(bio_err, "FILE:%s\n", p);
 
             if (www == 2) {
-                i = strlen(p);
+                i = (int)strlen(p);
                 if (((i > 5) && (strcmp(&(p[i - 5]), ".html") == 0)) ||
                     ((i > 4) && (strcmp(&(p[i - 4]), ".php") == 0)) ||
                     ((i > 4) && (strcmp(&(p[i - 4]), ".htm") == 0)))
@@ -3667,7 +3667,7 @@ static int rev_body(int s, int stype, int prot, unsigned char *context)
     }
     if (context != NULL
         && !SSL_set_session_id_context(con, context,
-                                       strlen((char *)context))) {
+                                       (unsigned int)strlen((char *)context))) {
         SSL_free(con);
         ERR_print_errors(bio_err);
         goto err;
@@ -3798,7 +3798,7 @@ static int generate_session_id(SSL *ssl, unsigned char *id,
                                unsigned int *id_len)
 {
     unsigned int count = 0;
-    unsigned int session_id_prefix_len = strlen(session_id_prefix);
+    unsigned int session_id_prefix_len = (unsigned int)strlen(session_id_prefix);
 
     do {
         if (RAND_bytes(id, *id_len) <= 0)
index 54b3d055634b0ec8291383fd3784f8cdfcd84b20..c19669b2612369f511ff033396c98e940073c6bb 100644 (file)
@@ -114,7 +114,7 @@ int sess_id_main(int argc, char **argv)
             goto end;
         }
         if (!SSL_SESSION_set1_id_context(x, (unsigned char *)context,
-                                         ctx_len)) {
+                                         (unsigned int)ctx_len)) {
             BIO_printf(bio_err, "Error setting id context\n");
             goto end;
         }
index 6c1eb59e91eefe96ceec732bb06c9a966471ed72..2c3ec37d1239ed061c076f9564b773c5f415b1fb 100644 (file)
@@ -2727,7 +2727,7 @@ int speed_main(int argc, char **argv)
 
     if (doit[D_HMAC]) {
         static const char hmac_key[] = "This is a key...";
-        int len = strlen(hmac_key);
+        int len = (int)strlen(hmac_key);
         size_t hmac_name_len = sizeof("hmac()") + strlen(evp_mac_mdname);
         OSSL_PARAM params[3];
 
@@ -5128,7 +5128,7 @@ static void multiblock_speed(const EVP_CIPHER *evp_cipher, int lengths_single,
                 aad[12] = (unsigned char)(len);
                 pad = EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_TLS1_AAD,
                                           EVP_AEAD_TLS1_AAD_LEN, aad);
-                ciph_success = EVP_Cipher(ctx, out, inp, len + pad);
+                ciph_success = EVP_Cipher(ctx, out, inp, (unsigned int)(len + pad));
             }
         }
         d = Time_F(STOP);
index 4d6709367f000bb35d1c60c548b4c661d613c857..6051d8642f0af32fc682c968a08005f64ce6dfae 100644 (file)
@@ -1258,7 +1258,7 @@ static int parse_ext_names(char *names, const char **result)
     int cnt = 0, len = 0;
 
     p = q = names;
-    len = strlen(names);
+    len = (int)strlen(names);
 
     while (q - names <= len) {
         if (*q != ',' && *q != '\0') {