mirror of https://github.com/wolfSSL/wolfssl.git
Merge branch 'master' of github.com:cyassl/cyassl
commit
1cfd4e01cb
|
@ -1283,7 +1283,7 @@ int DtlsPoolSave(CYASSL* ssl, const byte *src, int sz)
|
||||||
pBuf->buffer = (byte*)XMALLOC(sz, ssl->heap, DYNAMIC_TYPE_OUT_BUFFER);
|
pBuf->buffer = (byte*)XMALLOC(sz, ssl->heap, DYNAMIC_TYPE_OUT_BUFFER);
|
||||||
if (pBuf->buffer == NULL) {
|
if (pBuf->buffer == NULL) {
|
||||||
CYASSL_MSG("DTLS Buffer Memory error");
|
CYASSL_MSG("DTLS Buffer Memory error");
|
||||||
return MEMORY_E;
|
return MEMORY_ERROR;
|
||||||
}
|
}
|
||||||
XMEMCPY(pBuf->buffer, src, sz);
|
XMEMCPY(pBuf->buffer, src, sz);
|
||||||
pBuf->length = (word32)sz;
|
pBuf->length = (word32)sz;
|
||||||
|
@ -3316,7 +3316,8 @@ int SendChangeCipher(CYASSL* ssl)
|
||||||
|
|
||||||
#ifdef CYASSL_DTLS
|
#ifdef CYASSL_DTLS
|
||||||
if (ssl->options.dtls) {
|
if (ssl->options.dtls) {
|
||||||
DtlsPoolSave(ssl, output, sendSz);
|
if ((ret = DtlsPoolSave(ssl, output, sendSz)) != 0)
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef CYASSL_CALLBACKS
|
#ifdef CYASSL_CALLBACKS
|
||||||
|
@ -3520,7 +3521,9 @@ static int BuildMessage(CYASSL* ssl, byte* output, const byte* input, int inSz,
|
||||||
if (type == handshake) {
|
if (type == handshake) {
|
||||||
#ifdef CYASSL_DTLS
|
#ifdef CYASSL_DTLS
|
||||||
if (ssl->options.dtls) {
|
if (ssl->options.dtls) {
|
||||||
DtlsPoolSave(ssl, output, headerSz+inSz);
|
int ret;
|
||||||
|
if ((ret = DtlsPoolSave(ssl, output, headerSz+inSz)) != 0)
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
HashOutput(ssl, output, headerSz + inSz, ivSz);
|
HashOutput(ssl, output, headerSz + inSz, ivSz);
|
||||||
|
@ -3596,7 +3599,8 @@ int SendFinished(CYASSL* ssl)
|
||||||
}
|
}
|
||||||
#ifdef CYASSL_DTLS
|
#ifdef CYASSL_DTLS
|
||||||
if (ssl->options.dtls) {
|
if (ssl->options.dtls) {
|
||||||
DtlsPoolSave(ssl, output, sendSz);
|
if ((ret = DtlsPoolSave(ssl, output, sendSz)) != 0)
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -3679,7 +3683,8 @@ int SendCertificate(CYASSL* ssl)
|
||||||
}
|
}
|
||||||
#ifdef CYASSL_DTLS
|
#ifdef CYASSL_DTLS
|
||||||
if (ssl->options.dtls) {
|
if (ssl->options.dtls) {
|
||||||
DtlsPoolSave(ssl, output, sendSz);
|
if ((ret = DtlsPoolSave(ssl, output, sendSz)) != 0)
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
HashOutput(ssl, output, sendSz, 0);
|
HashOutput(ssl, output, sendSz, 0);
|
||||||
|
@ -3753,7 +3758,8 @@ int SendCertificateRequest(CYASSL* ssl)
|
||||||
|
|
||||||
#ifdef CYASSL_DTLS
|
#ifdef CYASSL_DTLS
|
||||||
if (ssl->options.dtls) {
|
if (ssl->options.dtls) {
|
||||||
DtlsPoolSave(ssl, output, sendSz);
|
if ((ret = DtlsPoolSave(ssl, output, sendSz)) != 0)
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
HashOutput(ssl, output, sendSz, 0);
|
HashOutput(ssl, output, sendSz, 0);
|
||||||
|
@ -5023,7 +5029,8 @@ int SetCipherList(Suites* s, const char* list)
|
||||||
|
|
||||||
#ifdef CYASSL_DTLS
|
#ifdef CYASSL_DTLS
|
||||||
if (ssl->options.dtls) {
|
if (ssl->options.dtls) {
|
||||||
DtlsPoolSave(ssl, output, sendSz);
|
if ((ret = DtlsPoolSave(ssl, output, sendSz)) != 0)
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
HashOutput(ssl, output, sendSz, 0);
|
HashOutput(ssl, output, sendSz, 0);
|
||||||
|
@ -5631,7 +5638,8 @@ int SetCipherList(Suites* s, const char* list)
|
||||||
idx += encSz; */
|
idx += encSz; */
|
||||||
#ifdef CYASSL_DTLS
|
#ifdef CYASSL_DTLS
|
||||||
if (ssl->options.dtls) {
|
if (ssl->options.dtls) {
|
||||||
DtlsPoolSave(ssl, output, sendSz);
|
if ((ret = DtlsPoolSave(ssl, output, sendSz)) != 0)
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
HashOutput(ssl, output, sendSz, 0);
|
HashOutput(ssl, output, sendSz, 0);
|
||||||
|
@ -5771,7 +5779,8 @@ int SetCipherList(Suites* s, const char* list)
|
||||||
#ifdef CYASSL_DTLS
|
#ifdef CYASSL_DTLS
|
||||||
if (ssl->options.dtls) {
|
if (ssl->options.dtls) {
|
||||||
sendSz += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA;
|
sendSz += DTLS_RECORD_EXTRA + DTLS_HANDSHAKE_EXTRA;
|
||||||
DtlsPoolSave(ssl, output, sendSz);
|
if ((ret = DtlsPoolSave(ssl, output, sendSz)) != 0)
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
HashOutput(ssl, output, sendSz, 0);
|
HashOutput(ssl, output, sendSz, 0);
|
||||||
|
@ -5877,7 +5886,8 @@ int SetCipherList(Suites* s, const char* list)
|
||||||
ssl->buffers.outputBuffer.length += sendSz;
|
ssl->buffers.outputBuffer.length += sendSz;
|
||||||
#ifdef CYASSL_DTLS
|
#ifdef CYASSL_DTLS
|
||||||
if (ssl->options.dtls) {
|
if (ssl->options.dtls) {
|
||||||
DtlsPoolSave(ssl, output, sendSz);
|
if ((ret = DtlsPoolSave(ssl, output, sendSz)) != 0)
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
HashOutput(ssl, output, sendSz, 0);
|
HashOutput(ssl, output, sendSz, 0);
|
||||||
|
@ -6342,7 +6352,8 @@ int SetCipherList(Suites* s, const char* list)
|
||||||
|
|
||||||
#ifdef CYASSL_DTLS
|
#ifdef CYASSL_DTLS
|
||||||
if (ssl->options.dtls) {
|
if (ssl->options.dtls) {
|
||||||
DtlsPoolSave(ssl, output, sendSz);
|
if ((ret = DtlsPoolSave(ssl, output, sendSz)) != 0)
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
HashOutput(ssl, output, sendSz, 0);
|
HashOutput(ssl, output, sendSz, 0);
|
||||||
|
@ -7199,7 +7210,8 @@ int SetCipherList(Suites* s, const char* list)
|
||||||
|
|
||||||
#ifdef CYASSL_DTLS
|
#ifdef CYASSL_DTLS
|
||||||
if (ssl->options.dtls) {
|
if (ssl->options.dtls) {
|
||||||
DtlsPoolSave(ssl, output, sendSz);
|
if ((ret = DtlsPoolSave(ssl, output, sendSz)) != 0)
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
HashOutput(ssl, output, sendSz, 0);
|
HashOutput(ssl, output, sendSz, 0);
|
||||||
|
|
|
@ -2244,7 +2244,7 @@ int CyaSSL_dtls_get_current_timeout(CYASSL* ssl)
|
||||||
#ifdef CYASSL_DTLS
|
#ifdef CYASSL_DTLS
|
||||||
return ssl->dtls_timeout;
|
return ssl->dtls_timeout;
|
||||||
#else
|
#else
|
||||||
return SSL_NOT_IMPLEMENTED;
|
return NOT_COMPILED_IN;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2259,7 +2259,7 @@ int CyaSSL_dtls_got_timeout(CYASSL* ssl)
|
||||||
return result;
|
return result;
|
||||||
#else
|
#else
|
||||||
(void)ssl;
|
(void)ssl;
|
||||||
return SSL_NOT_IMPLEMENTED;
|
return NOT_COMPILED_IN;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue