Bug 1011009 - BER decoder for Boolean accepts only (0,1)
Summary: BER decoder for Boolean accepts only (0,1)
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-pyasn1
Version: 18
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Rob Crittenden
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-23 13:23 UTC by Ludwig
Modified: 2013-09-30 13:54 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-30 13:54:29 UTC
Type: Bug


Attachments (Terms of Use)
pcap shwoing the encoded value (2.78 KB, application/vnd.tcpdump.pcap)
2013-09-23 15:40 UTC, Ludwig
no flags Details
wireshark highlighting the field (128.76 KB, image/png)
2013-09-23 15:41 UTC, Ludwig
no flags Details
C program to write out a BER file using openldap (898 bytes, text/x-csrc)
2013-09-23 18:23 UTC, Rob Crittenden
no flags Details
python-pyasn1 script to read the ber file (331 bytes, text/x-python)
2013-09-23 18:24 UTC, Rob Crittenden
no flags Details

Description Ludwig 2013-09-23 13:23:48 UTC
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

8.2.2
If the boolean value is:
FALSE
the octet shall be zero.
If the boolean value is
TRUE
the octet shall have any non-zero value, as a sender's option.
EXAMPLE
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):

0.1.2
How reproducible:
always

Steps to Reproduce:
1.
encode a ber message with the openldap function 
ber_printf(ber,"b",1);
It is encoded as 0xff

2.
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""

3.

Actual results:


Expected results:


Additional info:

Comment 1 Ludwig 2013-09-23 15:40:51 UTC
Created attachment 801739 [details]
pcap shwoing the encoded value

Comment 2 Ludwig 2013-09-23 15:41:59 UTC
Created attachment 801742 [details]
wireshark highlighting the field

Comment 3 Rob Crittenden 2013-09-23 18:23:34 UTC
Created attachment 801850 [details]
C program to write out a BER file using openldap

Comment 4 Rob Crittenden 2013-09-23 18:24:25 UTC
Created attachment 801851 [details]
python-pyasn1 script to read the ber file

This demonstrates the bug as reported

Comment 5 Rob Crittenden 2013-09-23 19:45:13 UTC
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?

Comment 6 Ludwig 2013-09-24 07:28:39 UTC
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 ?

Comment 7 Rob Crittenden 2013-09-24 12:15:25 UTC
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

Comment 8 Rob Crittenden 2013-09-30 13:54:29 UTC
I'm going to close this since it works in F-19 and 20.


Note You need to log in before you can comment on or make changes to this bug.