Merge pull request 'fix compilation warnings' (#67) from fix_compilation_warnings into master
Reviewed-on: http://13.234.246.121:3000/Neominds/ossl35vx69/pulls/67
This commit is contained in:
@@ -21,8 +21,8 @@
|
||||
#include <openssl/hmac.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#undef BUFSIZE
|
||||
#define BUFSIZE 1024*8
|
||||
#undef OSSL_DGST_BUFSIZE
|
||||
#define OSSL_DGST_BUFSIZE 1024*8
|
||||
|
||||
static int do_fp_oneshot_sign(BIO *out, EVP_MD_CTX *ctx, BIO *in, int sep, int binout,
|
||||
EVP_PKEY *key, unsigned char *sigin, int siglen,
|
||||
@@ -119,7 +119,7 @@ int dgst_main(int argc, char **argv)
|
||||
|
||||
reset_unknown();
|
||||
|
||||
buf = app_malloc(BUFSIZE, "I/O buffer");
|
||||
buf = app_malloc(OSSL_DGST_BUFSIZE, "I/O buffer");
|
||||
md = (EVP_MD *)EVP_get_digestbyname(argv[0]);
|
||||
if (md != NULL)
|
||||
digestname = argv[0];
|
||||
@@ -488,7 +488,7 @@ int dgst_main(int argc, char **argv)
|
||||
end:
|
||||
if (ret != EXIT_SUCCESS)
|
||||
ERR_print_errors(bio_err);
|
||||
OPENSSL_clear_free(buf, BUFSIZE);
|
||||
OPENSSL_clear_free(buf, OSSL_DGST_BUFSIZE);
|
||||
BIO_free(in);
|
||||
OPENSSL_free(passin);
|
||||
BIO_free_all(out);
|
||||
@@ -625,12 +625,12 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout, int xoflen
|
||||
const char *sig_name, const char *md_name,
|
||||
const char *file)
|
||||
{
|
||||
size_t len = BUFSIZE;
|
||||
size_t len = OSSL_DGST_BUFSIZE;
|
||||
int i, ret = EXIT_FAILURE;
|
||||
unsigned char *allocated_buf = NULL;
|
||||
|
||||
while (BIO_pending(bp) || !BIO_eof(bp)) {
|
||||
i = BIO_read(bp, (char *)buf, BUFSIZE);
|
||||
i = BIO_read(bp, (char *)buf, OSSL_DGST_BUFSIZE);
|
||||
if (i < 0) {
|
||||
BIO_printf(bio_err, "Read error in %s\n", file);
|
||||
goto end;
|
||||
@@ -656,7 +656,7 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout, int xoflen
|
||||
BIO_printf(bio_err, "Error getting maximum length of signed data\n");
|
||||
goto end;
|
||||
}
|
||||
if (tmplen > BUFSIZE) {
|
||||
if (tmplen > OSSL_DGST_BUFSIZE) {
|
||||
len = tmplen;
|
||||
allocated_buf = app_malloc(len, "Signature buffer");
|
||||
buf = allocated_buf;
|
||||
@@ -669,7 +669,7 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout, int xoflen
|
||||
EVP_MD_CTX *ctx;
|
||||
|
||||
len = xoflen;
|
||||
if (len > BUFSIZE) {
|
||||
if (len > OSSL_DGST_BUFSIZE) {
|
||||
allocated_buf = app_malloc(len, "Digest buffer");
|
||||
buf = allocated_buf;
|
||||
}
|
||||
@@ -681,7 +681,7 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout, int xoflen
|
||||
goto end;
|
||||
}
|
||||
} else {
|
||||
len = BIO_gets(bp, (char *)buf, BUFSIZE);
|
||||
len = BIO_gets(bp, (char *)buf, OSSL_DGST_BUFSIZE);
|
||||
if ((int)len < 0)
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "apps.h"
|
||||
#include "progs.h"
|
||||
|
||||
#define BUFSIZE 4096
|
||||
#define OSSL_FIPS_BUFSIZE 4096
|
||||
|
||||
/* Configuration file values */
|
||||
#define VERSION_KEY "version"
|
||||
@@ -272,7 +272,7 @@ static int do_mac(EVP_MAC_CTX *ctx, unsigned char *tmp, BIO *in,
|
||||
goto err;
|
||||
if (EVP_MAC_CTX_get_mac_size(ctx) > outsz)
|
||||
goto end;
|
||||
while ((i = BIO_read(in, (char *)tmp, BUFSIZE)) != 0) {
|
||||
while ((i = BIO_read(in, (char *)tmp, OSSL_FIPS_BUFSIZE)) != 0) {
|
||||
if (i < 0 || !EVP_MAC_update(ctx, tmp, i))
|
||||
goto err;
|
||||
}
|
||||
@@ -808,7 +808,7 @@ int fipsinstall_main(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
read_buffer = app_malloc(BUFSIZE, "I/O buffer");
|
||||
read_buffer = app_malloc(OSSL_FIPS_BUFSIZE, "I/O buffer");
|
||||
if (read_buffer == NULL)
|
||||
goto end;
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
#include <openssl/params.h>
|
||||
#include <openssl/core_names.h>
|
||||
|
||||
#undef BUFSIZE
|
||||
#define BUFSIZE 1024*8
|
||||
#undef OSSL_MAC_BUFSIZE
|
||||
#define OSSL_MAC_BUFSIZE 1024*8
|
||||
|
||||
typedef enum OPTION_choice {
|
||||
OPT_COMMON,
|
||||
@@ -91,7 +91,7 @@ int mac_main(int argc, char **argv)
|
||||
OSSL_PARAM *params = NULL;
|
||||
|
||||
prog = opt_init(argc, argv, mac_options);
|
||||
buf = app_malloc(BUFSIZE, "I/O buffer");
|
||||
buf = app_malloc(OSSL_MAC_BUFSIZE, "I/O buffer");
|
||||
while ((o = opt_next()) != OPT_EOF) {
|
||||
switch (o) {
|
||||
default:
|
||||
@@ -183,7 +183,7 @@ opthelp:
|
||||
}
|
||||
|
||||
while (BIO_pending(in) || !BIO_eof(in)) {
|
||||
i = BIO_read(in, (char *)buf, BUFSIZE);
|
||||
i = BIO_read(in, (char *)buf, OSSL_MAC_BUFSIZE);
|
||||
if (i < 0) {
|
||||
BIO_printf(bio_err, "Read Error in '%s'\n", infile);
|
||||
ERR_print_errors(bio_err);
|
||||
@@ -201,12 +201,12 @@ opthelp:
|
||||
BIO_printf(bio_err, "EVP_MAC_final failed\n");
|
||||
goto err;
|
||||
}
|
||||
if (len > BUFSIZE) {
|
||||
if (len > OSSL_MAC_BUFSIZE) {
|
||||
BIO_printf(bio_err, "output len is too large\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!EVP_MAC_final(ctx, buf, &len, BUFSIZE)) {
|
||||
if (!EVP_MAC_final(ctx, buf, &len, OSSL_MAC_BUFSIZE)) {
|
||||
BIO_printf(bio_err, "EVP_MAC_final failed\n");
|
||||
goto err;
|
||||
}
|
||||
@@ -224,7 +224,7 @@ opthelp:
|
||||
err:
|
||||
if (ret != 0)
|
||||
ERR_print_errors(bio_err);
|
||||
OPENSSL_clear_free(buf, BUFSIZE);
|
||||
OPENSSL_clear_free(buf, OSSL_MAC_BUFSIZE);
|
||||
OPENSSL_free(cipher);
|
||||
OPENSSL_free(digest);
|
||||
sk_OPENSSL_STRING_free(opts);
|
||||
|
||||
@@ -25,16 +25,16 @@
|
||||
# if defined(__GNUC__) || defined(__clang__)
|
||||
# define INLINE_UNUSED __inline__ __attribute__((__unused__,__always_inline__))
|
||||
# define RESTRICT __restrict__
|
||||
# define ALIGNED __attribute__((__aligned__(16)))
|
||||
# define OSSL_ALIGNED __attribute__((__aligned__(16)))
|
||||
# else
|
||||
# define INLINE_UNUSED ossl_inline
|
||||
# define RESTRICT
|
||||
# define ALIGNED
|
||||
# define OSSL_ALIGNED
|
||||
# endif
|
||||
|
||||
typedef struct gf_s {
|
||||
word_t limb[NLIMBS];
|
||||
} ALIGNED gf_s, gf[1];
|
||||
} OSSL_ALIGNED gf_s, gf[1];
|
||||
|
||||
/* RFC 7748 support */
|
||||
# define X_PUBLIC_BYTES X_SER_BYTES
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "ipcrypto_config.h"
|
||||
#include <openssl/crypto.h>
|
||||
#include <vxtss_symlist.h>
|
||||
#include <taskHookLib.h>
|
||||
#endif
|
||||
|
||||
static int stopped = 0;
|
||||
|
||||
@@ -1194,7 +1194,7 @@ int RAND_poll(void)
|
||||
|
||||
for (i=0;i<10;i++)
|
||||
{
|
||||
if (randPseudoBytes(tmp, sizeof(tmp)) == OK)
|
||||
if (randPseudoBytes((unsigned char *)tmp, sizeof(tmp)) == OK)
|
||||
(void)RAND_add(tmp, sizeof(tmp), sizeof(tmp));
|
||||
else
|
||||
return 0;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <vxWorks.h>
|
||||
#include <private/semLibP.h>
|
||||
#include <openssl/crypto.h>
|
||||
#include <vxtss.h>
|
||||
|
||||
#if defined(OPENSSL_THREADS) && !defined(CRYPTO_TDEBUG) && defined(OPENSSL_SYS_VXWORKS)
|
||||
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
#include <openssl/buffer.h>
|
||||
#include <openssl/txt_db.h>
|
||||
|
||||
#undef BUFSIZE
|
||||
#define BUFSIZE 512
|
||||
#undef OSSL_TXT_DB_BUFSIZE
|
||||
#define OSSL_TXT_DB_BUFSIZE 512
|
||||
|
||||
TXT_DB *TXT_DB_read(BIO *in, int num)
|
||||
{
|
||||
TXT_DB *ret = NULL;
|
||||
int esc = 0;
|
||||
int i, add, n;
|
||||
int size = BUFSIZE;
|
||||
int size = OSSL_TXT_DB_BUFSIZE;
|
||||
int offset = 0;
|
||||
char *p, *f;
|
||||
OPENSSL_STRING *pp;
|
||||
@@ -54,7 +54,7 @@ TXT_DB *TXT_DB_read(BIO *in, int num)
|
||||
offset = 0;
|
||||
for (;;) {
|
||||
if (offset != 0) {
|
||||
size += BUFSIZE;
|
||||
size += OSSL_TXT_DB_BUFSIZE;
|
||||
if (!BUF_MEM_grow_clean(buf, size))
|
||||
goto err;
|
||||
}
|
||||
|
||||
+3
-3
@@ -22,7 +22,7 @@
|
||||
|
||||
extern const OSSL_DISPATCH ossl_template_asym_kem_functions[];
|
||||
|
||||
#define BUFSIZE 1000
|
||||
#define OSSL_KEM_BUFSIZE 1000
|
||||
#if defined(NDEBUG) || defined(OPENSSL_NO_STDIO)
|
||||
static void debug_print(char *fmt, ...)
|
||||
{
|
||||
@@ -31,11 +31,11 @@ static void debug_print(char *fmt, ...)
|
||||
#else
|
||||
static void debug_print(char *fmt, ...)
|
||||
{
|
||||
char out[BUFSIZE];
|
||||
char out[OSSL_KEM_BUFSIZE];
|
||||
va_list argptr;
|
||||
|
||||
va_start(argptr, fmt);
|
||||
vsnprintf(out, BUFSIZE, fmt, argptr);
|
||||
vsnprintf(out, OSSL_KEM_BUFSIZE, fmt, argptr);
|
||||
va_end(argptr);
|
||||
if (getenv("TEMPLATEKEM"))
|
||||
fprintf(stderr, "TEMPLATE_KEM: %s", out);
|
||||
|
||||
+3
-3
@@ -24,7 +24,7 @@
|
||||
|
||||
extern const OSSL_DISPATCH ossl_template_keymgmt_functions[];
|
||||
|
||||
#define BUFSIZE 1000
|
||||
#define OSSL_KMGMT_BUFSIZE 1000
|
||||
#if defined(NDEBUG) || defined(OPENSSL_NO_STDIO)
|
||||
static void debug_print(char *fmt, ...)
|
||||
{
|
||||
@@ -32,11 +32,11 @@ static void debug_print(char *fmt, ...)
|
||||
#else
|
||||
static void debug_print(char *fmt, ...)
|
||||
{
|
||||
char out[BUFSIZE];
|
||||
char out[OSSL_KMGMT_BUFSIZE];
|
||||
va_list argptr;
|
||||
|
||||
va_start(argptr, fmt);
|
||||
vsnprintf(out, BUFSIZE, fmt, argptr);
|
||||
vsnprintf(out, OSSL_KMGMT_BUFSIZE, fmt, argptr);
|
||||
va_end(argptr);
|
||||
if (getenv("TEMPLATEKM"))
|
||||
fprintf(stderr, "TEMPLATE_KM: %s", out);
|
||||
|
||||
Reference in New Issue
Block a user