mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 04:04:39 +02:00
fix DLTS cookieSz init problem
This commit is contained in:
@@ -101,11 +101,12 @@ enum CyaSSL_ErrorCodes {
|
|||||||
OCSP_CERT_UNKNOWN = -266, /* OCSP responder doesn't know */
|
OCSP_CERT_UNKNOWN = -266, /* OCSP responder doesn't know */
|
||||||
OCSP_LOOKUP_FAIL = -267, /* OCSP lookup not successful */
|
OCSP_LOOKUP_FAIL = -267, /* OCSP lookup not successful */
|
||||||
MAX_CHAIN_ERROR = -268, /* max chain depth exceeded */
|
MAX_CHAIN_ERROR = -268, /* max chain depth exceeded */
|
||||||
|
COOKIE_ERROR = -269, /* dtls cookie error */
|
||||||
/* add strings to SetErrorString !!!!! */
|
/* add strings to SetErrorString !!!!! */
|
||||||
|
|
||||||
/* begin negotiation parameter errors */
|
/* begin negotiation parameter errors */
|
||||||
UNSUPPORTED_SUITE = -270, /* unsupported cipher suite */
|
UNSUPPORTED_SUITE = -290, /* unsupported cipher suite */
|
||||||
MATCH_SUITE_ERROR = -271 /* can't match cipher suite */
|
MATCH_SUITE_ERROR = -291 /* can't match cipher suite */
|
||||||
/* end negotiation parameter errors only 10 for now */
|
/* end negotiation parameter errors only 10 for now */
|
||||||
/* add strings to SetErrorString !!!!! */
|
/* add strings to SetErrorString !!!!! */
|
||||||
};
|
};
|
||||||
|
@@ -919,6 +919,7 @@ int InitSSL(CYASSL* ssl, CYASSL_CTX* ctx)
|
|||||||
ssl->keys.dtls_handshake_number = 0;
|
ssl->keys.dtls_handshake_number = 0;
|
||||||
ssl->keys.dtls_epoch = 0;
|
ssl->keys.dtls_epoch = 0;
|
||||||
ssl->keys.dtls_peer_epoch = 0;
|
ssl->keys.dtls_peer_epoch = 0;
|
||||||
|
ssl->arrays.cookieSz = 0;
|
||||||
#endif
|
#endif
|
||||||
ssl->keys.encryptionOn = 0; /* initially off */
|
ssl->keys.encryptionOn = 0; /* initially off */
|
||||||
ssl->options.sessionCacheOff = ctx->sessionCacheOff;
|
ssl->options.sessionCacheOff = ctx->sessionCacheOff;
|
||||||
@@ -3769,6 +3770,10 @@ void SetErrorString(int error, char* str)
|
|||||||
XSTRNCPY(str, "Maximum Chain Depth Exceeded", max);
|
XSTRNCPY(str, "Maximum Chain Depth Exceeded", max);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case COOKIE_ERROR:
|
||||||
|
XSTRNCPY(str, "DTLS Cookie Error", max);
|
||||||
|
break;
|
||||||
|
|
||||||
default :
|
default :
|
||||||
XSTRNCPY(str, "unknown error number", max);
|
XSTRNCPY(str, "unknown error number", max);
|
||||||
}
|
}
|
||||||
@@ -6453,7 +6458,7 @@ int SetCipherList(Suites* s, const char* list)
|
|||||||
return INCOMPLETE_DATA;
|
return INCOMPLETE_DATA;
|
||||||
cookieSz = EmbedGenerateCookie(cookie, COOKIE_SZ, ssl);
|
cookieSz = EmbedGenerateCookie(cookie, COOKIE_SZ, ssl);
|
||||||
if ((b != cookieSz) || XMEMCMP(cookie, input + i, b) != 0)
|
if ((b != cookieSz) || XMEMCMP(cookie, input + i, b) != 0)
|
||||||
return PARSE_ERROR;
|
return COOKIE_ERROR;
|
||||||
i += b;
|
i += b;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -602,9 +602,7 @@ THREAD_RETURN CYASSL_THREAD test_server_nofail(void* args)
|
|||||||
}
|
}
|
||||||
ssl = CyaSSL_new(ctx);
|
ssl = CyaSSL_new(ctx);
|
||||||
tcp_accept(&sockfd, &clientfd, (func_args*)args, yasslPort, 0, 0);
|
tcp_accept(&sockfd, &clientfd, (func_args*)args, yasslPort, 0, 0);
|
||||||
#ifndef CYASSL_DTLS
|
|
||||||
CloseSocket(sockfd);
|
CloseSocket(sockfd);
|
||||||
#endif
|
|
||||||
|
|
||||||
CyaSSL_set_fd(ssl, clientfd);
|
CyaSSL_set_fd(ssl, clientfd);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user