copy cbioFlag from ctx to ssl

This commit is contained in:
Takashi Kojo
2018-08-02 04:48:39 +09:00
parent 96c1a567f0
commit 98f6ae16ca
2 changed files with 3 additions and 8 deletions

View File

@@ -4625,6 +4625,7 @@ int InitSSL(WOLFSSL* ssl, WOLFSSL_CTX* ctx, int writeDup)
/* copy over application session context ID */
ssl->sessionCtxSz = ctx->sessionCtxSz;
XMEMCPY(ssl->sessionCtx, ctx->sessionCtx, ctx->sessionCtxSz);
ssl->cbioFlag = ctx->cbioFlag;
#endif
InitCiphers(ssl);

View File

@@ -11060,17 +11060,11 @@ int wolfSSL_set_compression(WOLFSSL* ssl)
ssl->biowr = wr;
/* set SSL to use BIO callbacks instead */
if (
#ifdef OPENSSL_EXTRA
((ssl->cbioFlag & WOLFSSL_CBIO_RECV) != 0) &&
#endif
if (((ssl->cbioFlag & WOLFSSL_CBIO_RECV) != 0) &&
(rd != NULL && rd->type != WOLFSSL_BIO_SOCKET)) {
ssl->CBIORecv = BioReceive;
}
if (
#ifdef OPENSSL_EXTRA
((ssl->cbioFlag & WOLFSSL_CBIO_SEND) != 0) &&
#endif
if (((ssl->cbioFlag & WOLFSSL_CBIO_SEND) != 0) &&
(wr != NULL && wr->type != WOLFSSL_BIO_SOCKET)) {
ssl->CBIOSend = BioSend;
}