components/openssl/openssl-1.0.1-fips-140/patches/39_parfait_fixes.patch
changeset 1958 baa0bfe12186
equal deleted inserted replaced
1957:598963179485 1958:baa0bfe12186
       
     1 # This patch was developed in-house
       
     2 # Patch submitted to upstream 
       
     3 --- openssl-1.0.1h/crypto/ocsp/ocsp_ht.c.~1~	Tue Jun 10 12:56:08 2014
       
     4 +++ openssl-1.0.1h/crypto/ocsp/ocsp_ht.c	Tue Jun 10 12:55:30 2014
       
     5 @@ -158,8 +158,15 @@
       
     6  
       
     7  	OCSP_REQ_CTX *rctx;
       
     8  	rctx = OPENSSL_malloc(sizeof(OCSP_REQ_CTX));
       
     9 +	if (!rctx)
       
    10 +		return 0;
       
    11  	rctx->state = OHS_ERROR;
       
    12  	rctx->mem = BIO_new(BIO_s_mem());
       
    13 +	if (!rctx->mem)
       
    14 +		{
       
    15 +		OCSP_REQ_CTX_free(rctx);
       
    16 +		return 0;
       
    17 +		}
       
    18  	rctx->io = io;
       
    19  	rctx->asn1_len = 0;
       
    20  	if (maxline > 0)
       
    21 @@ -168,15 +175,24 @@
       
    22  		rctx->iobuflen = OCSP_MAX_LINE_LEN;
       
    23  	rctx->iobuf = OPENSSL_malloc(rctx->iobuflen);
       
    24  	if (!rctx->iobuf)
       
    25 +		{
       
    26 +		OCSP_REQ_CTX_free(rctx);
       
    27  		return 0;
       
    28 +		}
       
    29  	if (!path)
       
    30  		path = "/";
       
    31  
       
    32          if (BIO_printf(rctx->mem, post_hdr, path) <= 0)
       
    33 +		{
       
    34 +		OCSP_REQ_CTX_free(rctx);
       
    35  		return 0;
       
    36 +		}
       
    37  
       
    38  	if (req && !OCSP_REQ_CTX_set1_req(rctx, req))
       
    39 +		{
       
    40 +		OCSP_REQ_CTX_free(rctx);
       
    41  		return 0;
       
    42 +		}
       
    43  
       
    44  	return rctx;
       
    45  	}
       
    46 @@ -490,6 +506,9 @@
       
    47  
       
    48  	ctx = OCSP_sendreq_new(b, path, req, -1);
       
    49  
       
    50 +	if (!ctx)
       
    51 +		return NULL;
       
    52 +
       
    53  	do
       
    54  		{
       
    55  		rv = OCSP_sendreq_nbio(&resp, ctx);
       
    56 --- openssl-1.0.1h/ssl/d1_both.c.~1~	Tue Jun  3 14:16:25 2014
       
    57 +++ openssl-1.0.1h/ssl/d1_both.c	Tue Jun  3 14:17:26 2014
       
    58 @@ -1172,6 +1172,8 @@
       
    59  
       
    60  	frag = dtls1_hm_fragment_new(s->init_num, 0);
       
    61  
       
    62 +	if (!frag)
       
    63 +		return 0;
       
    64  	memcpy(frag->fragment, s->init_buf->data, s->init_num);
       
    65  
       
    66  	if ( is_ccs)