Bug 1011009

Summary: BER decoder for Boolean accepts only (0,1)
Product: [Fedora] Fedora Reporter: Ludwig <lkrispen>
Component: python-pyasn1Assignee: Rob Crittenden <rcritten>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: lkrispen, rcritten, vanmeeuwen+fedora
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-30 13:54:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
pcap shwoing the encoded value
none
wireshark highlighting the field
none
C program to write out a BER file using openldap
none
python-pyasn1 script to read the ber file none

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.