Fixed.
Thanks!

BTW: Something is wrong with your mail client as raw MIME could not be
committed.

Alon.

On 9/10/08, Stanislav Brabec <[EMAIL PROTECTED]> wrote:
> Attached fix fixes two apparent bugs in the C code:
>
>  entersafe_init_pin_info() was declared as int, but defined and used as
>  void, resulting in a function returning an unused pseudo-random value.
>
>  card-gemsafeV1.c uses comparison 'type == "DF"', which is always false,
>  as it compares pointer to a string with pointer to the string "DF" in
>  the code.
>
>  --- src/libopensc/card-entersafe.c
>  +++ src/libopensc/card-entersafe.c
>  @@ -913,7 +913,7 @@
>          return 
> entersafe_compute_with_prkey(card,crgram,crgram_len,out,outlen);
>   }
>
>  -static int entersafe_init_pin_info(struct sc_pin_cmd_pin *pin, unsigned int 
> num)
>  +static void entersafe_init_pin_info(struct sc_pin_cmd_pin *pin, unsigned 
> int num)
>   {
>         pin->encoding   = SC_PIN_ENCODING_ASCII;
>         pin->min_length = 4;
>  --- src/libopensc/card-gemsafeV1.c
>  +++ src/libopensc/card-gemsafeV1.c
>  @@ -332,7 +332,7 @@
>
>         tag = sc_asn1_find_tag(ctx, p, len, 0x8C, &tlen);
>         if (tag) {
>  -               r = gemsafe_setacl(card, file, tag, type == "DF" ? 1 : 0);
>  +               r = gemsafe_setacl(card, file, tag, strcmp(type, "DF") ? 0 : 
> 1);
>                 if (r < 0) {
>                         sc_debug(ctx, "unable to set ACL\n");
>                         return SC_ERROR_INTERNAL;
>
>
>  --
>  Best Regards / S pozdravem,
>
>  Stanislav Brabec
>  software developer
>  ---------------------------------------------------------------------
>  SUSE LINUX, s. r. o.                          e-mail: [EMAIL PROTECTED]
>  Lihovarská 1060/12           tel: +420 284 028 966, +49 911 740538747
>  190 00 Praha 9                                  fax: +420 284 028 951
>  Czech Republic                                    http://www.suse.cz/
>
>  _______________________________________________
>  opensc-devel mailing list
>  [email protected]
>  http://www.opensc-project.org/mailman/listinfo/opensc-devel
>
_______________________________________________
opensc-devel mailing list
[email protected]
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to