forked from wolfSSL/wolfssl
warnings when using g++ compiler
This commit is contained in:
@ -9637,7 +9637,7 @@ int wc_EccPublicKeyDecode(const byte* input, word32* inOutIdx,
|
|||||||
/* build DER formatted ECC key, include optional public key if requested,
|
/* build DER formatted ECC key, include optional public key if requested,
|
||||||
* return length on success, negative on error */
|
* return length on success, negative on error */
|
||||||
static int wc_BuildEccKeyDer(ecc_key* key, byte* output, word32 inLen,
|
static int wc_BuildEccKeyDer(ecc_key* key, byte* output, word32 inLen,
|
||||||
int public)
|
int pubIn)
|
||||||
{
|
{
|
||||||
byte curve[MAX_ALGO_SZ+2];
|
byte curve[MAX_ALGO_SZ+2];
|
||||||
byte ver[MAX_VERSION_SZ];
|
byte ver[MAX_VERSION_SZ];
|
||||||
@ -9678,8 +9678,8 @@ static int wc_BuildEccKeyDer(ecc_key* key, byte* output, word32 inLen,
|
|||||||
}
|
}
|
||||||
prvidx += privSz;
|
prvidx += privSz;
|
||||||
|
|
||||||
/* public */
|
/* pubIn */
|
||||||
if (public) {
|
if (pubIn) {
|
||||||
ret = wc_ecc_export_x963(key, NULL, &pubSz);
|
ret = wc_ecc_export_x963(key, NULL, &pubSz);
|
||||||
if (ret != LENGTH_ONLY_E) {
|
if (ret != LENGTH_ONLY_E) {
|
||||||
XFREE(prv, key->heap, DYNAMIC_TYPE_TMP_BUFFER);
|
XFREE(prv, key->heap, DYNAMIC_TYPE_TMP_BUFFER);
|
||||||
@ -9717,7 +9717,7 @@ static int wc_BuildEccKeyDer(ecc_key* key, byte* output, word32 inLen,
|
|||||||
totalSz = prvidx + pubidx + curveidx + verSz + seqSz;
|
totalSz = prvidx + pubidx + curveidx + verSz + seqSz;
|
||||||
if (totalSz > (int)inLen) {
|
if (totalSz > (int)inLen) {
|
||||||
XFREE(prv, key->heap, DYNAMIC_TYPE_TMP_BUFFER);
|
XFREE(prv, key->heap, DYNAMIC_TYPE_TMP_BUFFER);
|
||||||
if (public) {
|
if (pubIn) {
|
||||||
XFREE(pub, key->heap, DYNAMIC_TYPE_TMP_BUFFER);
|
XFREE(pub, key->heap, DYNAMIC_TYPE_TMP_BUFFER);
|
||||||
}
|
}
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
@ -9741,8 +9741,8 @@ static int wc_BuildEccKeyDer(ecc_key* key, byte* output, word32 inLen,
|
|||||||
XMEMCPY(output + idx, curve, curveidx);
|
XMEMCPY(output + idx, curve, curveidx);
|
||||||
idx += curveidx;
|
idx += curveidx;
|
||||||
|
|
||||||
/* public */
|
/* pubIn */
|
||||||
if (public) {
|
if (pubIn) {
|
||||||
XMEMCPY(output + idx, pub, pubidx);
|
XMEMCPY(output + idx, pub, pubidx);
|
||||||
/* idx += pubidx; not used after write, if more data remove comment */
|
/* idx += pubidx; not used after write, if more data remove comment */
|
||||||
XFREE(pub, key->heap, DYNAMIC_TYPE_TMP_BUFFER);
|
XFREE(pub, key->heap, DYNAMIC_TYPE_TMP_BUFFER);
|
||||||
|
@ -834,8 +834,7 @@ static int wc_PKCS7_SignedDataBuildSignature(PKCS7* pkcs7,
|
|||||||
* type - [OUT] pointer to wc_HashType for output
|
* type - [OUT] pointer to wc_HashType for output
|
||||||
*
|
*
|
||||||
* returns hash digest size on success, negative on error */
|
* returns hash digest size on success, negative on error */
|
||||||
static enum wc_HashType wc_PKCS7_SetHashType(PKCS7* pkcs7,
|
static int wc_PKCS7_SetHashType(PKCS7* pkcs7, enum wc_HashType* type)
|
||||||
enum wc_HashType* type)
|
|
||||||
{
|
{
|
||||||
if (pkcs7 == NULL || type == NULL)
|
if (pkcs7 == NULL || type == NULL)
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
|
@ -761,15 +761,15 @@ int wc_scrypt(byte* output, const byte* passwd, int passLen,
|
|||||||
|
|
||||||
bSz = 128 * blockSize;
|
bSz = 128 * blockSize;
|
||||||
blocksSz = bSz * parallel;
|
blocksSz = bSz * parallel;
|
||||||
blocks = XMALLOC(blocksSz, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
blocks = (byte*)XMALLOC(blocksSz, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||||
if (blocks == NULL)
|
if (blocks == NULL)
|
||||||
goto end;
|
goto end;
|
||||||
/* Temporary for scryptROMix. */
|
/* Temporary for scryptROMix. */
|
||||||
v = XMALLOC((1 << cost) * bSz, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
v = (byte*)XMALLOC((1 << cost) * bSz, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||||
if (v == NULL)
|
if (v == NULL)
|
||||||
goto end;
|
goto end;
|
||||||
/* Temporary for scryptBlockMix. */
|
/* Temporary for scryptBlockMix. */
|
||||||
y = XMALLOC(blockSize * 128, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
y = (byte*)XMALLOC(blockSize * 128, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||||
if (y == NULL)
|
if (y == NULL)
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user