Skip to content

Commit 6d8fc3e

Browse files
Merge pull request #179 from sebastian-carpenter/buffer-init-with-string
Fixed problems with string init of array
2 parents 3358d3d + 74a30c3 commit 6d8fc3e

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/genkey/clu_genkey.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ int wolfCLU_genKey_ED25519(WC_RNG* rng, char* fOutNm, int directive, int format)
4040
int fOutNmSz; /* file name without append */
4141
int fOutNmAppendSz = 6; /* # of bytes to append to file name */
4242
int flagOutputPub = 0; /* set if outputting both priv/pub */
43-
char privAppend[6] = ".priv\0"; /* last part of the priv file name */
44-
char pubAppend[6] = ".pub\0\0"; /* last part of the pub file name*/
43+
char privAppend[6] = ".priv"; /* last part of the priv file name */
44+
char pubAppend[6] = ".pub"; /* last part of the pub file name*/
4545
byte privKeyBuf[ED25519_KEY_SIZE*2]; /* will hold public & private parts */
4646
byte pubKeyBuf[ED25519_KEY_SIZE]; /* holds just the public key part */
4747
word32 privKeySz; /* size of private key */
@@ -611,8 +611,8 @@ int wolfCLU_GenAndOutput_ECC(WC_RNG* rng, char* fName, int directive,
611611
#ifdef HAVE_ECC
612612
int fNameSz;
613613
int fExtSz = 6;
614-
char fExtPriv[6] = ".priv\0";
615-
char fExtPub[6] = ".pub\0\0";
614+
char fExtPriv[6] = ".priv";
615+
char fExtPub[6] = ".pub";
616616
char* fOutNameBuf = NULL;
617617

618618
WOLFSSL_BIO *bioPub = NULL;
@@ -790,8 +790,8 @@ int wolfCLU_genKey_RSA(WC_RNG* rng, char* fName, int directive, int fmt, int
790790
int ret = WOLFCLU_SUCCESS; /* return value */
791791
int fNameSz; /* file name without append */
792792
int fExtSz = 6; /* number of bytes to append to file name */
793-
char fExtPriv[6] = ".priv\0"; /* last part of the priv file name */
794-
char fExtPub[6] = ".pub\0\0"; /* last part of the pub file name*/
793+
char fExtPriv[6] = ".priv"; /* last part of the priv file name */
794+
char fExtPub[6] = ".pub"; /* last part of the pub file name*/
795795
char* fOutNameBuf = NULL; /* file name + fExt */
796796
int flagOutputPub = 0; /* set if outputting both priv/pub */
797797
byte* derBuf = NULL; /* buffer for DER format */
@@ -1044,8 +1044,8 @@ int wolfCLU_genKey_Dilithium(WC_RNG* rng, char* fName, int directive, int fmt,
10441044
XFILE file = NULL;
10451045
int fNameSz = 0;
10461046
int fExtSz = 6; // size of ".priv\0" or ".pub\0\0"
1047-
char fExtPriv[6] = ".priv\0";
1048-
char fExtPub[6] = ".pub\0\0";
1047+
char fExtPriv[6] = ".priv";
1048+
char fExtPub[6] = ".pub";
10491049
char* fOutNameBuf = NULL;
10501050

10511051
#ifdef NO_AES
@@ -1403,8 +1403,8 @@ int wolfCLU_genKey_XMSS(WC_RNG* rng, char* fName,
14031403
int ret = 0;
14041404
int fNameSz = 0; /* file name without append */
14051405
int fExtSz = 6; /* size of ".priv\0" and ".pub\0\0" */
1406-
char fExtPriv[6] = ".priv\0";
1407-
char fExtPub[6] = ".pub\0\0";
1406+
char fExtPriv[6] = ".priv";
1407+
char fExtPub[6] = ".pub";
14081408
char* fOutNameBuf = NULL; /* file name + fExt */
14091409
XFILE file = NULL; /* public key file */
14101410
byte* pubOutBuf = NULL; /* public key buffer */

src/genkey/clu_genkey_setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ int wolfCLU_genKeySetup(int argc, char** argv)
2929
{
3030
#ifndef WOLFCLU_NO_FILESYSTEM
3131
char keyOutFName[MAX_FILENAME_SZ]; /* default outFile for genKey */
32-
char defaultFormat[4] = "der\0";
32+
char defaultFormat[4] = "der";
3333
WC_RNG rng;
3434

3535
char* keyType = NULL; /* keyType */

0 commit comments

Comments
 (0)