|
|
Re: libopensc asn1 boolean handling: msg#00264
encryption.opensc.devel
|
Subject: |
Re: libopensc asn1 boolean handling |
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?
or to use 'int' in the asn.1 code ... thanks for the bug report I will
look at it.
Nils
|
|