Merge pull request #2777 from dgarske/constchar

Fixes for char strings not marked as const.
pull/2787/head
toddouska 2020-02-03 11:12:55 -08:00 committed by GitHub
commit 63a73be3f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 19 deletions

View File

@ -21864,8 +21864,8 @@ int wolfSSL_X509_cmp(const WOLFSSL_X509 *a, const WOLFSSL_X509 *b)
/* print signature algo */
{
int oid;
char* sig;
int oid;
const char* sig;
if ((oid = wolfSSL_X509_get_signature_type(x509)) <= 0) {
WOLFSSL_MSG("Error getting x509 signature type");

View File

@ -496,56 +496,56 @@ static int GetInteger7Bit(const byte* input, word32* inOutIdx, word32 maxIdx)
#if !defined(NO_DSA) && !defined(NO_SHA)
static char sigSha1wDsaName[] = "SHAwDSA";
static const char sigSha1wDsaName[] = "SHAwDSA";
#endif /* NO_DSA */
#ifndef NO_RSA
#ifdef WOLFSSL_MD2
static char sigMd2wRsaName[] = "md2WithRSAEncryption";
static const char sigMd2wRsaName[] = "md2WithRSAEncryption";
#endif
#ifndef NO_MD5
static char sigMd5wRsaName[] = "md5WithRSAEncryption";
static const char sigMd5wRsaName[] = "md5WithRSAEncryption";
#endif
#ifndef NO_SHA
static char sigSha1wRsaName[] = "sha1WithRSAEncryption";
static const char sigSha1wRsaName[] = "sha1WithRSAEncryption";
#endif
#ifdef WOLFSSL_SHA224
static char sigSha224wRsaName[] = "sha224WithRSAEncryption";
static const char sigSha224wRsaName[] = "sha224WithRSAEncryption";
#endif
#ifndef NO_SHA256
static char sigSha256wRsaName[] = "sha256WithRSAEncryption";
static const char sigSha256wRsaName[] = "sha256WithRSAEncryption";
#endif
#ifdef WOLFSSL_SHA384
static char sigSha384wRsaName[] = "sha384WithRSAEncryption";
static const char sigSha384wRsaName[] = "sha384WithRSAEncryption";
#endif
#ifdef WOLFSSL_SHA512
static char sigSha512wRsaName[] = "sha512WithRSAEncryption";
static const char sigSha512wRsaName[] = "sha512WithRSAEncryption";
#endif
#endif /* NO_RSA */
#ifdef HAVE_ECC
#ifndef NO_SHA
static char sigSha1wEcdsaName[] = "SHAwECDSA";
static const char sigSha1wEcdsaName[] = "SHAwECDSA";
#endif
#ifdef WOLFSSL_SHA224
static char sigSha224wEcdsaName[] = "SHA224wECDSA";
static const char sigSha224wEcdsaName[] = "SHA224wECDSA";
#endif
#ifndef NO_SHA256
static char sigSha256wEcdsaName[] = "SHA256wECDSA";
static const char sigSha256wEcdsaName[] = "SHA256wECDSA";
#endif
#ifdef WOLFSSL_SHA384
static char sigSha384wEcdsaName[] = "SHA384wECDSA";
static const char sigSha384wEcdsaName[] = "SHA384wECDSA";
#endif
#ifdef WOLFSSL_SHA512
static char sigSha512wEcdsaName[] = "SHA512wECDSA";
static const char sigSha512wEcdsaName[] = "SHA512wECDSA";
#endif
#endif /* HAVE_ECC */
static char sigUnknownName[] = "Unknown";
static const char sigUnknownName[] = "Unknown";
/* Get the human readable string for a signature type
*
* oid Oid value for signature
*/
char* GetSigName(int oid) {
const char* GetSigName(int oid) {
switch (oid) {
#if !defined(NO_DSA) && !defined(NO_SHA)
case CTC_SHAwDSA:
@ -15067,7 +15067,7 @@ int wc_EccPublicKeyDecode(const byte* input, word32* inOutIdx,
ret = MEMORY_E;
if (ret == 0) {
static char customName[] = "Custom";
static const char customName[] = "Custom";
XMEMSET(curve, 0, sizeof(*curve));
#ifndef WOLFSSL_ECC_CURVE_STATIC
curve->name = customName;

View File

@ -1103,7 +1103,7 @@ WOLFSSL_LOCAL int GetShortInt(const byte* input, word32* inOutIdx, int* number,
WOLFSSL_LOCAL int SetShortInt(byte* input, word32* inOutIdx, word32 number,
word32 maxIdx);
WOLFSSL_LOCAL char* GetSigName(int oid);
WOLFSSL_LOCAL const char* GetSigName(int oid);
WOLFSSL_LOCAL int GetLength(const byte* input, word32* inOutIdx, int* len,
word32 maxIdx);
WOLFSSL_LOCAL int GetLength_ex(const byte* input, word32* inOutIdx, int* len,