matrixssl: clean up GCC 15 build warnings
This commit is contained in:
@@ -52,7 +52,9 @@
|
||||
/* Determine the operating system (if any) */
|
||||
# if defined(__linux__) /* Linux and Android */
|
||||
# define POSIX
|
||||
# define LINUX
|
||||
# ifndef LINUX
|
||||
# define LINUX
|
||||
# endif
|
||||
# ifndef NO_FILE_SYSTEM
|
||||
# define MATRIX_USE_FILE_SYSTEM
|
||||
# endif
|
||||
@@ -434,4 +436,3 @@ typedef SEM_ID psMutex_t;
|
||||
|
||||
# endif /* !PS_UNSUPPORTED_OS */
|
||||
#endif /* _h_PS_PLATFORM_TYPES */
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ psResSize_t psChacha20Poly1305IetfEncryptDetached(
|
||||
const unsigned char *Aad_p,
|
||||
psSize_t AadNBytes,
|
||||
unsigned char *Ciphertext_p,
|
||||
unsigned char Mac_p[PS_EXACTLY(PS_CHACHA20POLY1305_IETF_ABYTES)])
|
||||
unsigned char *Mac_p)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -141,7 +141,7 @@ psResSize_t psChacha20Poly1305IetfDecryptDetached(
|
||||
const unsigned char Iv_p[PS_EXACTLY(PS_CHACHA20POLY1305_IETF_NPUBBYTES)],
|
||||
const unsigned char *Aad_p,
|
||||
psSizeL_t AadNBytes,
|
||||
const unsigned char Mac_p[PS_EXACTLY(PS_CHACHA20POLY1305_IETF_ABYTES)],
|
||||
const unsigned char *Mac_p,
|
||||
unsigned char *Plaintext_p)
|
||||
{
|
||||
psSizeL_t plaintextNBytes = CiphertextNBytes; /* Plaintext length is the same than ciphertext length. */
|
||||
@@ -308,4 +308,3 @@ psResSize_t psChacha20Poly1305IetfDecrypt(
|
||||
/************************************************************************************/
|
||||
|
||||
#endif /* USE_MATRIX_CHACHA20_POLY1305_IETF */
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@ PSPUBLIC void psAesClearCBC(psAesCbc_t *ctx);
|
||||
PSPUBLIC int32_t psAesInitGCM(psAesGcm_t *ctx,
|
||||
const unsigned char key[AES_MAXKEYLEN], uint8_t keylen);
|
||||
PSPUBLIC void psAesReadyGCM(psAesGcm_t *ctx,
|
||||
const unsigned char IV[AES_IVLEN],
|
||||
const unsigned char *IV,
|
||||
const unsigned char *aad, psSize_t aadLen);
|
||||
PSPUBLIC int32_t psAesReadyGCMRandomIV(psAesGcm_t * ctx,
|
||||
unsigned char IV[12],
|
||||
@@ -294,7 +294,7 @@ PSPUBLIC psResSize_t psChacha20Poly1305IetfEncryptDetached(
|
||||
const unsigned char *Aad_p,
|
||||
psSize_t AadNBytes,
|
||||
unsigned char *Ciphertext_p,
|
||||
unsigned char Mac_p[PS_EXACTLY(PS_CHACHA20POLY1305_IETF_ABYTES)]);
|
||||
unsigned char *Mac_p);
|
||||
|
||||
PSPUBLIC psResSize_t psChacha20Poly1305IetfDecryptDetached(
|
||||
psChacha20Poly1305Ietf_t Context_p[PS_EXACTLY(1)],
|
||||
@@ -303,7 +303,7 @@ PSPUBLIC psResSize_t psChacha20Poly1305IetfDecryptDetached(
|
||||
const unsigned char Iv_p[PS_EXACTLY(PS_CHACHA20POLY1305_IETF_NPUBBYTES)],
|
||||
const unsigned char *Aad_p,
|
||||
psSizeL_t AadNBytes,
|
||||
const unsigned char Mac_p[PS_EXACTLY(PS_CHACHA20POLY1305_IETF_ABYTES)],
|
||||
const unsigned char *Mac_p,
|
||||
unsigned char *Plaintext_p);
|
||||
|
||||
PSPUBLIC psResSize_t psChacha20Poly1305IetfEncrypt(
|
||||
@@ -546,7 +546,7 @@ PSPUBLIC int32_t psHmacSingle(psHmac_t *ctx,
|
||||
psSize_t keyLen,
|
||||
const unsigned char *in,
|
||||
psSizeL_t inLen,
|
||||
unsigned char out[MAX_HASHLEN]);
|
||||
unsigned char *out);
|
||||
|
||||
# ifdef USE_HKDF
|
||||
PSPUBLIC int32_t psHkdfExpand(psCipherType_e hmacAlg,
|
||||
@@ -561,7 +561,7 @@ PSPUBLIC int32_t psHkdfExtract(psCipherType_e hmacAlg,
|
||||
psSize_t saltLen,
|
||||
const unsigned char *ikm,
|
||||
psSize_t ikmLen,
|
||||
unsigned char prk[MAX_HASHLEN],
|
||||
unsigned char *prk,
|
||||
psSize_t *prkLen);
|
||||
PSPUBLIC int32_t psHkdfExpandLabel(psPool_t *pool,
|
||||
psCipherType_e hmacAlg,
|
||||
|
||||
@@ -144,7 +144,7 @@ int32_t psHkdfExtract(psCipherType_e hmacAlg,
|
||||
psSize_t saltLen,
|
||||
const unsigned char *ikm,
|
||||
psSize_t ikmLen,
|
||||
unsigned char prk[MAX_HASHLEN],
|
||||
unsigned char *prk,
|
||||
psSize_t *prkLen)
|
||||
{
|
||||
int32_t rc;
|
||||
|
||||
@@ -130,7 +130,7 @@ int32_t psHmacSingle(psHmac_t *ctx,
|
||||
psSize_t keyLen,
|
||||
const unsigned char *in,
|
||||
psSizeL_t inLen,
|
||||
unsigned char out[MAX_HASHLEN])
|
||||
unsigned char *out)
|
||||
{
|
||||
int32_t rc;
|
||||
|
||||
@@ -684,4 +684,3 @@ void psHmacSha384Final(psHmacSha384_t *ctx,
|
||||
#endif /* USE_MATRIX_HMAC_SHA384 */
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ void psAesClearGCM(psAesGcm_t *ctx)
|
||||
created with psAesInitGCM
|
||||
*/
|
||||
void psAesReadyGCM(psAesGcm_t *ctx,
|
||||
const unsigned char IV[AES_IVLEN],
|
||||
const unsigned char *IV,
|
||||
const unsigned char *aad, psSize_t aadLen)
|
||||
{
|
||||
psGhashInit(ctx, ctx->gInit);
|
||||
@@ -549,4 +549,3 @@ static void psGhashFinal(psAesGcm_t *ctx)
|
||||
#endif /* USE_MATRIX_AES_GCM */
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
|
||||
@@ -595,7 +595,7 @@ int32_t psAesInitGCM(psAesGcm_t *ctx,
|
||||
http://csrc.nist.gov/publications/nistpubs/800-38D/SP-800-38D.pdf
|
||||
*/
|
||||
void psAesReadyGCM(psAesGcm_t *ctx,
|
||||
const unsigned char IV[AES_IVLEN],
|
||||
const unsigned char *IV,
|
||||
const unsigned char *aad, psSize_t aadLen)
|
||||
{
|
||||
# ifdef PSTM_64BIT
|
||||
@@ -1045,4 +1045,3 @@ static void gcm_transform(psAesGcm_t *ctx, unsigned char *dest,
|
||||
#endif /* USE_AESNI_AES_GCM */
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ void psAesClearGCM(psAesGcm_t *ctx)
|
||||
created with psAesInitGCM
|
||||
*/
|
||||
void psAesReadyGCM(psAesGcm_t *ctx,
|
||||
const unsigned char IV[AES_IVLEN],
|
||||
const unsigned char *IV,
|
||||
const unsigned char *aad, psSize_t aadLen)
|
||||
{
|
||||
/* --- Set up context structure ---// */
|
||||
@@ -250,7 +250,7 @@ psResSize_t psChacha20Poly1305IetfEncryptDetached(
|
||||
const unsigned char *Aad_p,
|
||||
psSize_t AadNBytes,
|
||||
unsigned char *Ciphertext_p,
|
||||
unsigned char Mac_p[PS_EXACTLY(PS_CHACHA20POLY1305_IETF_ABYTES)])
|
||||
unsigned char *Mac_p)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -287,7 +287,7 @@ psResSize_t psChacha20Poly1305IetfDecryptDetached(
|
||||
const unsigned char Iv_p[PS_EXACTLY(PS_CHACHA20POLY1305_IETF_NPUBBYTES)],
|
||||
const unsigned char *Aad_p,
|
||||
psSizeL_t AadNBytes,
|
||||
const unsigned char Mac_p[PS_EXACTLY(PS_CHACHA20POLY1305_IETF_ABYTES)],
|
||||
const unsigned char *Mac_p,
|
||||
unsigned char *Plaintext_p)
|
||||
{
|
||||
psSizeL_t plaintextNBytes = CiphertextNBytes; /* Plaintext length is the same than ciphertext length. */
|
||||
|
||||
@@ -2404,13 +2404,13 @@ extern int32 csIdeaDecrypt(void *ssl, unsigned char *ct,
|
||||
# ifdef USE_PSK_CIPHER_SUITE
|
||||
|
||||
extern int32_t matrixSslPskGetKey(ssl_t * ssl,
|
||||
const unsigned char id[SSL_PSK_MAX_ID_SIZE], uint8_t idLen,
|
||||
unsigned char *key[SSL_PSK_MAX_KEY_SIZE], uint8_t * keyLen);
|
||||
const unsigned char *id, uint8_t idLen,
|
||||
unsigned char **key, uint8_t * keyLen);
|
||||
extern int32_t matrixSslPskGetKeyId(ssl_t * ssl,
|
||||
unsigned char *id[SSL_PSK_MAX_ID_SIZE], uint8_t * idLen,
|
||||
const unsigned char hint[SSL_PSK_MAX_HINT_SIZE], uint8_t hintLen);
|
||||
unsigned char **id, uint8_t * idLen,
|
||||
const unsigned char *hint, uint8_t hintLen);
|
||||
extern int32_t matrixPskGetHint(ssl_t * ssl,
|
||||
unsigned char *hint[SSL_PSK_MAX_HINT_SIZE], uint8_t * hintLen);
|
||||
unsigned char **hint, uint8_t * hintLen);
|
||||
# endif /* USE_PSK_CIPHER_SUITE */
|
||||
|
||||
# ifdef USE_ECC
|
||||
|
||||
@@ -115,7 +115,7 @@ int32_t matrixSslLoadPsk(sslKeys_t *keys,
|
||||
which PSK it might want to use.
|
||||
*/
|
||||
int32_t matrixPskGetHint(ssl_t *ssl,
|
||||
unsigned char *hint[SSL_PSK_MAX_HINT_SIZE], uint8_t *hintLen)
|
||||
unsigned char **hint, uint8_t *hintLen)
|
||||
{
|
||||
/*
|
||||
RFC4279: In the absence of an application profile specification specifying
|
||||
@@ -139,8 +139,8 @@ int32_t matrixPskGetHint(ssl_t *ssl,
|
||||
hint and hintLen are not currently used for the lookup
|
||||
*/
|
||||
int32_t matrixSslPskGetKeyId(ssl_t *ssl,
|
||||
unsigned char *id[SSL_PSK_MAX_ID_SIZE], uint8_t *idLen,
|
||||
const unsigned char hint[SSL_PSK_MAX_HINT_SIZE], uint8_t hintLen)
|
||||
unsigned char **id, uint8_t *idLen,
|
||||
const unsigned char *hint, uint8_t hintLen)
|
||||
{
|
||||
psPsk_t *psk;
|
||||
|
||||
@@ -163,8 +163,8 @@ int32_t matrixSslPskGetKeyId(ssl_t *ssl,
|
||||
pskCb, based on id,
|
||||
*/
|
||||
int32_t matrixSslPskGetKey(ssl_t *ssl,
|
||||
const unsigned char id[SSL_PSK_MAX_ID_SIZE], uint8_t idLen,
|
||||
unsigned char *key[SSL_PSK_MAX_KEY_SIZE], uint8_t *keyLen)
|
||||
const unsigned char *id, uint8_t idLen,
|
||||
unsigned char **key, uint8_t *keyLen)
|
||||
{
|
||||
psPsk_t *psk;
|
||||
|
||||
|
||||
@@ -6828,7 +6828,7 @@ static int nowDoCvPkaInnerECDSA(ssl_t *ssl, pkaAfter_t *pka,
|
||||
{
|
||||
return PS_MEM_FAIL;
|
||||
}
|
||||
tmpEcdsa[0] = (sigLen << 8) & 0xff00;
|
||||
tmpEcdsa[0] = (sigLen >> 8) & 0xff;
|
||||
tmpEcdsa[1] = sigLen & 0xff;
|
||||
Memcpy(&tmpEcdsa[2], sig, sigLen);
|
||||
len = sigLen + 2;
|
||||
|
||||
Reference in New Issue
Block a user