[PATCH] agent: pksign result conversion to sexp to upper layer

Werner Koch wk at gnupg.org
Wed Feb 27 09:48:48 CET 2013


On Mon, 25 Feb 2013 01:47, gniibe at fsij.org said:

> This patch moves the conversion/building of SEXP structure from
> agent_card_pksign to agent_pksign_do.

I see no problem with this change.

> -      size_t len = 0;
> +      int is_RSA = 0, is_ECDSA = 0;

Please change to 

         int is_RSA = 0;
         int is_ECDSA = 0;

as per GNU coding standards.

> +	if (r_buflen > len/2)
> +	  xfree (r_buf);
> +
> +	if (s_buflen > len/2)
> +	  xfree (s_buf);

These conditions are not easy to understand.  What about using an
explicit flag telling whether they have been allocated or to use an
alias variable initialized to NULL which may then always be freed?



Salam-Shalom,

   Werner

-- 
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.




More information about the Gnupg-devel mailing list