fix indentation -- no code changed.

This commit is contained in:
Moisés Guimarães
2014-09-08 21:34:07 -03:00
parent b22e3abfff
commit b2b5179392

View File

@@ -1797,8 +1797,8 @@ int CyaSSL_Init(void)
if (type == CERT_TYPE || type == CA_TYPE) { if (type == CERT_TYPE || type == CA_TYPE) {
XSTRNCPY(header, "-----BEGIN CERTIFICATE-----", sizeof(header)); XSTRNCPY(header, "-----BEGIN CERTIFICATE-----", sizeof(header));
XSTRNCPY(footer, "-----END CERTIFICATE-----", sizeof(footer)); XSTRNCPY(footer, "-----END CERTIFICATE-----", sizeof(footer));
dynamicType = (type == CA_TYPE) ? DYNAMIC_TYPE_CA : dynamicType = (type == CA_TYPE) ? DYNAMIC_TYPE_CA
DYNAMIC_TYPE_CERT; : DYNAMIC_TYPE_CERT;
} else if (type == CERTREQ_TYPE) { } else if (type == CERTREQ_TYPE) {
XSTRNCPY(header, "-----BEGIN CERTIFICATE REQUEST-----", XSTRNCPY(header, "-----BEGIN CERTIFICATE REQUEST-----",
sizeof(header)); sizeof(header));
@@ -2061,8 +2061,7 @@ int CyaSSL_Init(void)
CYASSL_MSG("Growing Tmp Chain Buffer"); CYASSL_MSG("Growing Tmp Chain Buffer");
bufferSz = (word32)(sz - consumed); bufferSz = (word32)(sz - consumed);
/* will shrink to actual size */ /* will shrink to actual size */
chainBuffer = (byte*)XMALLOC(bufferSz, heap, chainBuffer = (byte*)XMALLOC(bufferSz, heap, DYNAMIC_TYPE_FILE);
DYNAMIC_TYPE_FILE);
if (chainBuffer == NULL) { if (chainBuffer == NULL) {
#ifdef CYASSL_SMALL_STACK #ifdef CYASSL_SMALL_STACK
XFREE(info, NULL, DYNAMIC_TYPE_TMP_BUFFER); XFREE(info, NULL, DYNAMIC_TYPE_TMP_BUFFER);
@@ -2262,8 +2261,7 @@ int CyaSSL_Init(void)
else if (type == CERT_TYPE) { else if (type == CERT_TYPE) {
if (ssl) { if (ssl) {
if (ssl->buffers.weOwnCert && ssl->buffers.certificate.buffer) if (ssl->buffers.weOwnCert && ssl->buffers.certificate.buffer)
XFREE(ssl->buffers.certificate.buffer, heap, XFREE(ssl->buffers.certificate.buffer, heap, dynamicType);
dynamicType);
ssl->buffers.certificate = der; ssl->buffers.certificate = der;
ssl->buffers.weOwnCert = 1; ssl->buffers.weOwnCert = 1;
} }
@@ -2376,8 +2374,6 @@ int CyaSSL_Init(void)
} }
/* CA PEM file for verification, may have multiple/chain certs to process */ /* CA PEM file for verification, may have multiple/chain certs to process */
static int ProcessChainBuffer(CYASSL_CTX* ctx, const unsigned char* buff, static int ProcessChainBuffer(CYASSL_CTX* ctx, const unsigned char* buff,
long sz, int format, int type, CYASSL* ssl) long sz, int format, int type, CYASSL* ssl)
@@ -2774,7 +2770,8 @@ int ProcessFile(CYASSL_CTX* ctx, const char* fname, int format, int type,
} }
XFCLOSE(file); XFCLOSE(file);
if (dynamic) XFREE(myBuffer, heapHint, DYNAMIC_TYPE_FILE); if (dynamic)
XFREE(myBuffer, heapHint, DYNAMIC_TYPE_FILE);
return ret; return ret;
} }
@@ -2903,7 +2900,8 @@ int CyaSSL_CertManagerVerify(CYASSL_CERT_MANAGER* cm, const char* fname,
ret = CyaSSL_CertManagerVerifyBuffer(cm, myBuffer, sz, format); ret = CyaSSL_CertManagerVerifyBuffer(cm, myBuffer, sz, format);
XFCLOSE(file); XFCLOSE(file);
if (dynamic) XFREE(myBuffer, cm->heap, DYNAMIC_TYPE_FILE); if (dynamic)
XFREE(myBuffer, cm->heap, DYNAMIC_TYPE_FILE);
return ret; return ret;
} }
@@ -3418,7 +3416,8 @@ static int CyaSSL_SetTmpDH_file_wrapper(CYASSL_CTX* ctx, CYASSL* ssl,
} }
XFCLOSE(file); XFCLOSE(file);
if (dynamic) XFREE(myBuffer, ctx->heap, DYNAMIC_TYPE_FILE); if (dynamic)
XFREE(myBuffer, ctx->heap, DYNAMIC_TYPE_FILE);
return ret; return ret;
} }
@@ -9789,24 +9788,21 @@ CYASSL_X509* CyaSSL_X509_load_certificate_file(const char* fname, int format)
CYASSL_ENTER("CyaSSL_cmp_peer_cert_to_file"); CYASSL_ENTER("CyaSSL_cmp_peer_cert_to_file");
if (ssl != NULL && fname != NULL) if (ssl != NULL && fname != NULL)
{ {
XFILE file = XBADFILE;
long sz = 0;
#ifdef CYASSL_SMALL_STACK #ifdef CYASSL_SMALL_STACK
EncryptedInfo* info;
byte staticBuffer[1]; /* force heap usage */ byte staticBuffer[1]; /* force heap usage */
#else #else
EncryptedInfo info[1];
byte staticBuffer[FILE_BUFFER_SIZE]; byte staticBuffer[FILE_BUFFER_SIZE];
#endif #endif
byte* myBuffer = staticBuffer; byte* myBuffer = staticBuffer;
int dynamic = 0; int dynamic = 0;
CYASSL_CTX* ctx = ssl->ctx; XFILE file = XBADFILE;
buffer fileDer; long sz = 0;
int eccKey = 0; int eccKey = 0;
CYASSL_CTX* ctx = ssl->ctx;
CYASSL_X509* peer_cert = &ssl->peerCert; CYASSL_X509* peer_cert = &ssl->peerCert;
#ifdef CYASSL_SMALL_STACK buffer fileDer;
EncryptedInfo* info;
#else
EncryptedInfo info[1];
#endif
file = XFOPEN(fname, "rb"); file = XFOPEN(fname, "rb");
if (file == XBADFILE) if (file == XBADFILE)