|
Re: libopensc asn1 boolean handling: msg#00280encryption.opensc.devel
On Wed, Mar 30, 2005 at 07:39:24PM +0200, Nils Larsch wrote: > William Wanders wrote: > >Hello list, > > > >There seems to be a problem with handling / encoding / decoding > >values in libopensc that are stored as ASN1 boolean type. > >The higher level code represents these boolean values as integer > >values (0/1). However the encoding/decoding functions assume an > >u8 (unsigned char) type. > > > >For instance the authority boolean pkcs15-cert.c: > > > > if (infop->authority) > > sc_format_asn1_entry(asn1_com_cert_attr + 1, (void *) > > &infop->authority, NULL, 1); > > > >This will most likely cause problems on non little-endian systems. > >For testing purposes I replaced these constructs with something > >like which is a crude fix: > > if (infop->authority) { > > u8 authority=infop->authority; > > sc_format_asn1_entry(asn1_com_cert_attr + 1, (void *) > > &authority, NULL, 1); > > } > >However, it would probably be better to use the u8 type to store > >the boolean values for the authority/native attributes, wouldn't it? > > I've changed the asn.1 code to use integers instead of u8, a little > bit more type safety would have been nice here ... > Please test a new snapshot. I just updated my checked out subversion trunk of opensc and tested it on a Solaris Sparc based system and everything seems to work ok. William. |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Adding SC_FILE_STATUS_INITIALISATION status in sc_file_t: 00280, Stef Hoeben |
|---|---|
| Next by Date: | PKCS15 Emulation Routine for use with GemSAFE GPK 1600 Windows Initilized Cards: 00280, Douglas E. Engert |
| Previous by Thread: | Re: libopensc asn1 boolean handlingi: 00280, Nils Larsch |
| Next by Thread: | openct release: 00280, Andreas Jellinghaus |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |