<<< Date Index >>>     <<< Thread Index >>>

Re: issue with smime and mutt 1.5.5.1



On Sun, Jan 04, 2004 at 10:44:10AM +0100, Thomas Roessler wrote:
> On 2004-01-03 17:34:07 -0600, Will Fiveash wrote:
> 
> > I don't have smime_default_key set in .muttrc thus
> > SmimeDefaultKey is NULL.  Should I open a bug?
> 
> No. ;-)
> 
> --- smime.c   30 Dec 2003 13:04:20 -0000      3.30
> +++ smime.c   4 Jan 2004 09:40:56 -0000
> @@ -692,10 +692,10 @@
>    }
>  
>    snprintf (SmimeKeyToUse, sizeof (SmimeKeyToUse), "%s/%s", 
> -         NONULL (SmimeKeys), SmimeDefaultKey);
> +         NONULL (SmimeKeys), NONULL (SmimeDefaultKey));
>    
>    snprintf (SmimeCertToUse, sizeof (SmimeCertToUse), "%s/%s",
> -         NONULL (SmimeCertificates), SmimeDefaultKey);
> +         NONULL (SmimeCertificates), NONULL (SmimeDefaultKey));
>  }
>  
>  void smime_getkeys (ENVELOPE *env)

A couple issues:

1. There are other places where SmimeDefaultKey is used that may be a
   problem.  Look at smime_sign_message() and intermediates.  Is it
   possible that smime_get_field_from_db(NULL, SmimeDefaultKey, 1, 1)
   may return a non-NULL value when SmimeDefaultKey == NULL?  Also,
   there is:  

  snprintf (SmimeKeyToUse, sizeof (SmimeKeyToUse), "%s/%s", 
       NONULL(SmimeKeys), SmimeDefaultKey);

  snprintf (SmimeCertToUse, sizeof (SmimeCertToUse), "%s/%s",
       NONULL(SmimeCertificates), SmimeDefaultKey);

  in smime_sign_message().  You should examine all the places that
  SmimeDefaultKey is referenced.

2. Is it okay for _smime_getkeys() to set SmimeKeyToUse and
   SmimeCertToUse to "/" when SmimeKeys, SmimeDefaultKey,
   SmimeCertificates all = NULL?
-- 
Will Fiveash