Red Hat Bugzilla – Bug 1011009
BER decoder for Boolean accepts only (0,1)
Last modified: 2013-09-30 09:54:29 EDT
Description of problem:
the asn1 decoder only accepts (0,1) for Boolean, but the ITU x.690 spec in chapter 8.2 defines Boolean in BER
If the boolean value is:
the octet shall be zero.
If the boolean value is
the octet shall have any non-zero value, as a sender's option.
If of type BOOLEAN, the value TRUE can be encoded as:
Boolean Length Contents
01 01 FF
Version-Release number of selected component (if applicable):
Steps to Reproduce:
encode a ber message with the openldap function
It is encoded as 0xff
run python client decoding the message, an exception is raised:
pyasn1.type.error.ValueConstraintError: ConstraintsIntersection(ConstraintsIntersection(), SingleValueConstraint(0, 1)) failed at: "SingleValueConstraint(0, 1) failed at: "-1""
Created attachment 801739 [details]
pcap shwoing the encoded value
Created attachment 801742 [details]
wireshark highlighting the field
Created attachment 801850 [details]
C program to write out a BER file using openldap
Created attachment 801851 [details]
python-pyasn1 script to read the ber file
This demonstrates the bug as reported
This was fixed in 0.1.4 so I'll need to consider updating the package version in F-18. Is this work you're doing going to land in F-18?
I was using the python client to test a feature which will be in 389 version 1.3.2, so this would be in F20 I think.
I didn't see that it was fixed, is there a bz for that fix ?
F-20 has 0.1.7 and my testing confirms it works as expected.
The upstream 0.1.4 changelog has this, which I suspect is what fixed things:
- Fix to BER Boolean decoder that allows other pre-computed
values besides 0 and 1
I'm going to close this since it works in F-19 and 20.