remove warnings in card-gpk.c compilation

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

remove warnings in card-gpk.c compilation

Ludovic Rousseau
Hello,

When compiling card-gpk.c I have some warnings:
card-gpk.c: In function 'gpk_compute_crycks':
card-gpk.c:806: warning: passing argument 1 of 'DES_ecb3_encrypt' from
incompatible pointer type
card-gpk.c:806: warning: passing argument 2 of 'DES_ecb3_encrypt' from
incompatible pointer type
card-gpk.c: In function 'gpk_set_filekey':
card-gpk.c:943: warning: passing argument 1 of 'DES_ecb3_encrypt' from
incompatible pointer type
card-gpk.c:943: warning: passing argument 2 of 'DES_ecb3_encrypt' from
incompatible pointer type
card-gpk.c:945: warning: passing argument 1 of 'DES_ecb3_encrypt' from
incompatible pointer type
card-gpk.c:945: warning: passing argument 2 of 'DES_ecb3_encrypt' from
incompatible pointer type
card-gpk.c:955: warning: passing argument 1 of 'DES_ecb3_encrypt' from
incompatible pointer type
card-gpk.c:955: warning: passing argument 2 of 'DES_ecb3_encrypt' from
incompatible pointer type
card-gpk.c: In function 'gpk_pkfile_load':
card-gpk.c:1596: warning: passing argument 1 of 'DES_ecb3_encrypt'
from incompatible pointer type
card-gpk.c:1596: warning: passing argument 2 of 'DES_ecb3_encrypt'
from incompatible pointer type

I am not an OpenSSL expert and I did not try with an "old" OpenSSL. To
remove the warnings I just removed some explicit casts and changed
"des_cblock out;" in "u8 out[8];". The casts may be necessary for
other version of OpenSSL (I use 0.9.7g-1ubuntu1).

Patch attached (untested). Maybe we should release 0.10.0 first?

Bye,

--
  Dr. Ludovic Rousseau
 For private mail use [hidden email] and not "big brother" Google

_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: remove warnings in card-gpk.c compilation

Nils Larsch
Ludovic Rousseau wrote:
> Hello,
>
> When compiling card-gpk.c I have some warnings:

which compiler options ?

> card-gpk.c: In function 'gpk_compute_crycks':
> card-gpk.c:806: warning: passing argument 1 of 'DES_ecb3_encrypt' from
> incompatible pointer type
> card-gpk.c:806: warning: passing argument 2 of 'DES_ecb3_encrypt' from
> incompatible pointer type
> card-gpk.c: In function 'gpk_set_filekey':
> card-gpk.c:943: warning: passing argument 1 of 'DES_ecb3_encrypt' from
> incompatible pointer type
> card-gpk.c:943: warning: passing argument 2 of 'DES_ecb3_encrypt' from
> incompatible pointer type
> card-gpk.c:945: warning: passing argument 1 of 'DES_ecb3_encrypt' from
> incompatible pointer type
> card-gpk.c:945: warning: passing argument 2 of 'DES_ecb3_encrypt' from
> incompatible pointer type
> card-gpk.c:955: warning: passing argument 1 of 'DES_ecb3_encrypt' from
> incompatible pointer type
> card-gpk.c:955: warning: passing argument 2 of 'DES_ecb3_encrypt' from
> incompatible pointer type
> card-gpk.c: In function 'gpk_pkfile_load':
> card-gpk.c:1596: warning: passing argument 1 of 'DES_ecb3_encrypt'
> from incompatible pointer type
> card-gpk.c:1596: warning: passing argument 2 of 'DES_ecb3_encrypt'
> from incompatible pointer type
>
> I am not an OpenSSL expert and I did not try with an "old" OpenSSL. To
> remove the warnings I just removed some explicit casts and changed
> "des_cblock out;" in "u8 out[8];". The casts may be necessary for
> other version of OpenSSL (I use 0.9.7g-1ubuntu1)

Well as des_cblock (or better DES_cblock as des_cblock is deprecated)
is a typedef for unsigned char[8] hence this shouldn't cause problems
(but as the prototype of DES_ecb3_encrypt is
        void DES_ecb3_encrypt(const_DES_cblock *input,
                DES_cblock *output,
                DES_key_schedule *ks1,DES_key_schedule *ks2,
                DES_key_schedule *ks3, int enc);
it would be nice to use the DES_cblock type, I wonder what causes
these warnings).

Cheers,
Nils
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: remove warnings in card-gpk.c compilation

Andreas Jellinghaus-2
In reply to this post by Ludovic Rousseau
On Wednesday 12 October 2005 16:05, Ludovic Rousseau wrote:
> Hello,
>
> When compiling card-gpk.c I have some warnings:

no warnings with openss 0.9.8a, so I do not consider
this urgent, maybe not even an issue. no strong feelings
whether we want to change this or not.

> I am not an OpenSSL expert and I did not try with an "old" OpenSSL. To
> remove the warnings I just removed some explicit casts and changed
> "des_cblock out;" in "u8 out[8];". The casts may be necessary for
> other version of OpenSSL (I use 0.9.7g-1ubuntu1).
>
> Patch attached (untested). Maybe we should release 0.10.0 first?

please open a bug and attach it, so it is not lost.
I think past 0.10.0 is better.

Regards, Andreas
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel