List Info

Thread: OpenSSL: openssl/crypto/cms/ cms_enc.c cms_smime.c




OpenSSL: openssl/crypto/cms/ cms_enc.c cms_smime.c
country flaguser name
Germany
2008-03-15 08:37:32
  OpenSSL CVS Repository
  http://cvs.openssl.org/
 
____________________________________________________________
________________

  Server: cvs.openssl.org                  Name:   Dr.
Stephen Henson
  Root:   /v/openssl/cvs                   Email:  steveopenssl.org
  Module: openssl                          Date:  
15-Mar-2008 14:37:32
  Branch: HEAD                             Handle:
2008031513373200

  Modified files:
    openssl/crypto/cms      cms_enc.c cms_smime.c

  Log:
    Check for cipher BIO errors and set key length after
parameter decode.

  Summary:
    Revision    Changes     Path
    1.5         +12 -12     openssl/crypto/cms/cms_enc.c
    1.5         +9  -1      openssl/crypto/cms/cms_smime.c
 
____________________________________________________________
________________

  patch -p0 <<' .'
  Index: openssl/crypto/cms/cms_enc.c
 
============================================================
================
  $ cvs diff -u -r1.4 -r1.5 cms_enc.c
  --- openssl/crypto/cms/cms_enc.c	14 Mar 2008 23:30:56
-0000	1.4
  +++ openssl/crypto/cms/cms_enc.c	15 Mar 2008 13:37:32
-0000	1.5
   -115,18 +115,6 
   	if (enc)
   		calg->algorithm =
OBJ_nid2obj(EVP_CIPHER_CTX_type(ctx));
   
  -	/* If necessary set key length */
  -
  -	if (ec->keylen != EVP_CIPHER_CTX_key_length(ctx))
  -		{
  -		if (EVP_CIPHER_CTX_set_key_length(ctx, ec->keylen)
<= 0)
  -			{
  -			CMSerr(CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO,
  -				CMS_R_INVALID_KEY_LENGTH);
  -			goto err;
  -			}
  -		}
  -
   	if (enc)
   		{
   		int ivlen;
   -146,6 +134,18 
   			goto err;
   			}
   
  +	/* If necessary set key length */
  +
  +	if (ec->keylen != EVP_CIPHER_CTX_key_length(ctx))
  +		{
  +		if (EVP_CIPHER_CTX_set_key_length(ctx, ec->keylen)
<= 0)
  +			{
  +			CMSerr(CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO,
  +				CMS_R_INVALID_KEY_LENGTH);
  +			goto err;
  +			}
  +		}
  +
   	if (EVP_CipherInit_ex(ctx, NULL, NULL, ec->key, piv,
enc) <= 0)
   		{
   		CMSerr(CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO,
   .
  patch -p0 <<' .'
  Index: openssl/crypto/cms/cms_smime.c
 
============================================================
================
  $ cvs diff -u -r1.4 -r1.5 cms_smime.c
  --- openssl/crypto/cms/cms_smime.c	15 Mar 2008 00:02:23
-0000	1.4
  +++ openssl/crypto/cms/cms_smime.c	15 Mar 2008 13:37:32
-0000	1.5
   -77,12 +77,20 
   	else
   		tmpout = out;
   
  -	/* Read all content through chain to determine content
digests */
  +	/* Read all content through chain to process digest,
decrypt etc */
   	for (;;)
   	{
   		i=BIO_read(in,buf,sizeof(buf));
   		if (i <= 0)
  +			{
  +			if (BIO_method_type(in) == BIO_TYPE_CIPHER)
  +				{
  +				if (!BIO_get_cipher_status(in))
  +					goto err;
  +				}
   			break;
  +			}
  +				
   		if (tmpout)
   			BIO_write(tmpout, buf, i);
   	}
   .
____________________________________________________________
__________
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 )