Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/wolfsshd/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -2695,8 +2695,8 @@ static int RequestAuthentication(WS_UserAuthData* authData,
DecodedCert* dCert = &sdCert;
#endif

/* ret is still success unless the allocation above failed */
if (ret == WOLFSSH_USERAUTH_SUCCESS) {
/* NULL only when the small-stack allocation above failed */
if (dCert != NULL) {
Comment thread
ejohnstown marked this conversation as resolved.
wc_InitDecodedCert(dCert, authData->sf.publicKey.publicKey,
authData->sf.publicKey.publicKeySz, NULL);
if (wc_ParseCert(dCert, CERT_TYPE, NO_VERIFY, NULL) != 0) {
Expand Down
3 changes: 2 additions & 1 deletion src/certman.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,8 @@ int wolfSSH_CERTMAN_VerifyCerts_buffer(WOLFSSH_CERTMAN* cm,
}
#endif

if (ret == WS_SUCCESS) {
/* NULL only when the small-stack allocation above failed */
if (decoded != NULL) {
Comment thread
ejohnstown marked this conversation as resolved.
wc_InitDecodedCert(decoded, certLoc[0], certLen[0], cm->heap);
if (wc_ParseCert(decoded, WOLFSSL_FILETYPE_ASN1, NO_VERIFY, cm->cm)
!= 0) {
Expand Down
9 changes: 6 additions & 3 deletions src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -21853,11 +21853,14 @@ static int CompositeEccSign(void* key, WC_RNG* rng, void* heap,
ret = WS_MEMORY_E;
}
#else
byte rBuf[MAX_ECC_BYTES + ECC_MAX_PAD_SZ];
byte sBuf[MAX_ECC_BYTES + ECC_MAX_PAD_SZ];
byte rStore[MAX_ECC_BYTES + ECC_MAX_PAD_SZ];
byte sStore[MAX_ECC_BYTES + ECC_MAX_PAD_SZ];
byte* rBuf = rStore;
byte* sBuf = sStore;
#endif

if (ret == 0) {
/* NULL only when a small-stack allocation above failed */
if (rBuf != NULL && sBuf != NULL) {
Comment thread
ejohnstown marked this conversation as resolved.
ret = wc_ecc_sig_to_rs(asnSig, asnSigSz, rBuf, &rSz, sBuf, &sSz);
}
if (ret == 0) {
Expand Down
3 changes: 2 additions & 1 deletion src/keygen.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,8 @@ int wolfSSH_MakeMlDsaKey(byte* out, word32 outSz, word32 level)
}
#endif

if (ret == WS_SUCCESS) {
/* NULL only when the small-stack allocation above failed */
if (key != NULL) {
Comment thread
ejohnstown marked this conversation as resolved.
if (wc_MlDsaKey_Init(key, NULL, INVALID_DEVID) != 0)
ret = WS_CRYPTO_FAILED;
else {
Expand Down
2 changes: 1 addition & 1 deletion src/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ void* WS_CreateFileA(const char* fileName, unsigned long desiredAccess,
unsigned long shareMode, unsigned long creationDisposition,
unsigned long flags, void* heap)
{
HANDLE fileHandle;
HANDLE fileHandle = INVALID_HANDLE_VALUE;
wchar_t* unicodeFileName;
size_t unicodeFileNameSz = 0;
size_t returnSz = 0;
Expand Down
3 changes: 3 additions & 0 deletions src/wolfsftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3151,6 +3151,9 @@ static int SFTP_CreateLongName(WS_SFTPNAME* name)
mtime = (time_t)atr->mtime;

#if defined(WLOCALTIME)
/* WLOCALTIME is a per-port macro; zero first so nothing reads a stale
* struct if a port leaves it untouched. */
WMEMSET(&localTime, 0, sizeof(localTime));
if (!WLOCALTIME(&mtime, &localTime)) {
return WS_MEMORY_E;
}
Expand Down
Loading