List Info

Thread: OpenSSL: openssl/apps/ ts.c openssl/crypto/bn/ bntest.c openssl/...




OpenSSL: openssl/apps/ ts.c openssl/crypto/bn/ bntest.c openssl/...
user name
2006-03-18 14:27:42
  OpenSSL CVS Repository
  http://cvs.openssl.org/
 
____________________________________________________________
________________

  Server: cvs.openssl.org                  Name:   Nils
Larsch
  Root:   /v/openssl/cvs                   Email:  nilsopenssl.org
  Module: openssl                          Date:  
18-Mar-2006 15:27:42
  Branch: HEAD                             Handle:
2006031814274100

  Modified files:
    openssl/apps            ts.c
    openssl/crypto/bn       bntest.c
    openssl/crypto/ts       ts_rsp_sign.c

  Log:
    ensure the pointer is valid before using it

  Summary:
    Revision    Changes     Path
    1.4         +2  -0      openssl/apps/ts.c
    1.68        +2  -0      openssl/crypto/bn/bntest.c
    1.5         +20 -12     openssl/crypto/ts/ts_rsp_sign.c
 
____________________________________________________________
________________

  patch -p0 <<' .'
  Index: openssl/apps/ts.c
 
============================================================
================
  $ cvs diff -u -r1.3 -r1.4 ts.c
  --- openssl/apps/ts.c	26 Feb 2006 23:34:50 -0000	1.3
  +++ openssl/apps/ts.c	18 Mar 2006 14:27:41 -0000	1.4
   -1041,6 +1041,8 
   		if (!(request = d2i_TS_REQ_bio(input, NULL))) goto err;
   		if (!(ctx = TS_REQ_to_TS_VERIFY_CTX(request, NULL)))
goto err;
   		}
  +	else
  +		return NULL;
   
   	/* Add the signature verification flag and arguments. */
   	ctx->flags |= TS_VFY_SIGNATURE;
   .
  patch -p0 <<' .'
  Index: openssl/crypto/bn/bntest.c
 
============================================================
================
  $ cvs diff -u -r1.67 -r1.68 bntest.c
  --- openssl/crypto/bn/bntest.c	16 Dec 2005 10:37:24
-0000	1.67
  +++ openssl/crypto/bn/bntest.c	18 Mar 2006 14:27:41
-0000	1.68
   -732,6 +732,8 
   	BN_init(&n);
   
   	mont=BN_MONT_CTX_new();
  +	if (mont == NULL)
  +		return 0;
   
   	BN_bntest_rand(&a,100,0,0); /**/
   	BN_bntest_rand(&b,100,0,0); /**/
   .
  patch -p0 <<' .'
  Index: openssl/crypto/ts/ts_rsp_sign.c
 
============================================================
================
  $ cvs diff -u -r1.4 -r1.5 ts_rsp_sign.c
  --- openssl/crypto/ts/ts_rsp_sign.c	5 Mar 2006 20:19:04
-0000	1.4
  +++ openssl/crypto/ts/ts_rsp_sign.c	18 Mar 2006 14:27:41
-0000	1.5
   -466,18 +466,21 
   	if (!result)
   		{
   		TSerr(TS_F_TS_RESP_CREATE_RESPONSE,
TS_R_RESPONSE_SETUP_ERROR);
  -		TS_RESP_CTX_set_status_info_cond(ctx,
TS_STATUS_REJECTION,
  -						 "Error during response "
  -						 "generation.");
  -		/* Check if the status info was set. */
  -		if (ctx->response
  -		    && ASN1_INTEGER_get(
  -			   
TS_RESP_get_status_info(ctx->response)->status)
  -		    == TS_STATUS_GRANTED)
  +		if (ctx != NULL)
   			{
  -			/* Status info wasn't set, don't return a response.
*/
  -			TS_RESP_free(ctx->response);
  -			ctx->response = NULL;
  +			TS_RESP_CTX_set_status_info_cond(ctx,
  +				TS_STATUS_REJECTION, "Error during response
"
  +				"generation.");
  +			/* Check if the status info was set. */
  +			if (ctx->response && ASN1_INTEGER_get(
  +			   
TS_RESP_get_status_info(ctx->response)->status)
  +			    == TS_STATUS_GRANTED)
  +				{
  +				/* Status info wasn't set, don't
  +				 * return a response. */
  +				TS_RESP_free(ctx->response);
  +				ctx->response = NULL;
  +				}
   			}
   		}
   	response = ctx->response;
   -567,13 +570,18 
   	return 1;
   	}
   
  -/* Returns the TSA policy based on the rqeuested and
acceptable policies. */
  +/* Returns the TSA policy based on the requested and
acceptable policies. */
   static ASN1_OBJECT *TS_RESP_get_policy(TS_RESP_CTX *ctx)
   	{
   	ASN1_OBJECT *requested =
TS_REQ_get_policy_id(ctx->request);
   	ASN1_OBJECT *policy = NULL;
   	int i;
   
  +	if (ctx->default_policy == NULL)
  +		{
  +		TSerr(TS_F_TS_RESP_GET_POLICY,
TS_R_INVALID_NULL_POINTER);
  +		return NULL;
  +		}
   	/* Return the default policy if none is requested or the
default is
   	   requested. */
   	if (!requested || !OBJ_cmp(requested,
ctx->default_policy))
   .
____________________________________________________________
__________
OpenSSL Project                                 http://www.openssl.org
CVS Repository Commit List                    
openssl-cvsopenssl.org
Automated List Manager                          
majordomoopenssl.org
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )