fix mixed declarations by moving them to their block start

In Visual Studio <= 2012 C99 mixed declarations aren't supported.
This commit is contained in:
Jay Satiro 2015-08-10 01:54:25 -04:00
parent 106abb873f
commit e179da07d0
2 changed files with 9 additions and 4 deletions

View File

@ -14069,15 +14069,18 @@ int DoSessionTicket(WOLFSSL* ssl,
#endif #endif
if (TLSX_SupportExtensions(ssl)) { if (TLSX_SupportExtensions(ssl)) {
int ret = 0; int ret = 0;
/* auto populate extensions supported unless user defined */
if ((ret = TLSX_PopulateExtensions(ssl, 1)) != 0)
return ret;
#else #else
if (IsAtLeastTLSv1_2(ssl)) { if (IsAtLeastTLSv1_2(ssl)) {
#endif #endif
/* Process the hello extension. Skip unsupported. */ /* Process the hello extension. Skip unsupported. */
word16 totalExtSz; word16 totalExtSz;
#ifdef HAVE_TLS_EXTENSIONS
/* auto populate extensions supported unless user defined */
if ((ret = TLSX_PopulateExtensions(ssl, 1)) != 0)
return ret;
#endif
if ((i - begin) + OPAQUE16_LEN > helloSz) if ((i - begin) + OPAQUE16_LEN > helloSz)
return BUFFER_ERROR; return BUFFER_ERROR;

View File

@ -1492,11 +1492,13 @@ int wc_DsaKeyToDer(DsaKey* key, byte* output, word32 inLen)
sizes[i] = SetLength(rawLen, tmps[i] + 1) + 1 + lbit; /* tag & lbit */ sizes[i] = SetLength(rawLen, tmps[i] + 1) + 1 + lbit; /* tag & lbit */
if (sizes[i] <= MAX_SEQ_SZ) { if (sizes[i] <= MAX_SEQ_SZ) {
int err;
/* leading zero */ /* leading zero */
if (lbit) if (lbit)
tmps[i][sizes[i]-1] = 0x00; tmps[i][sizes[i]-1] = 0x00;
int err = mp_to_unsigned_bin(keyInt, tmps[i] + sizes[i]); err = mp_to_unsigned_bin(keyInt, tmps[i] + sizes[i]);
if (err == MP_OKAY) { if (err == MP_OKAY) {
sizes[i] += (rawLen-lbit); /* lbit included in rawLen */ sizes[i] += (rawLen-lbit); /* lbit included in rawLen */
intTotalLen += sizes[i]; intTotalLen += sizes[i];