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 */ /* copy over application session context ID */
ssl->sessionCtxSz = ctx->sessionCtxSz; ssl->sessionCtxSz = ctx->sessionCtxSz;
XMEMCPY(ssl->sessionCtx, ctx->sessionCtx, ctx->sessionCtxSz); XMEMCPY(ssl->sessionCtx, ctx->sessionCtx, ctx->sessionCtxSz);
ssl->cbioFlag = ctx->cbioFlag;
#endif #endif
InitCiphers(ssl); InitCiphers(ssl);

View File

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