Subject: BER and Attribute Syntax

From: "Steinitz, Dominic J" <[email-masked]>
Date: 21 Jun 2001 11:41:20 Z

I hope this is the right mailing list for asking these sort of questions. If not can someone please direct me to the correct one.

According to BER, the decimal number 1321should be encoded as Universal Primitive 2 1321= [2,2,5,41] but according to the attribute syntax definitions RFC2252 6.16, INTEGER attributes are encoded as a string of the decimal representation. So to encode an ASN.1 INTEGER we should use BER but to encode an INTEGER attribute we should produce an OctetString of the decimal value. Is this correct?

Dominic.

-------------------------------------------------------------------------------------------------
21st century air travel     http://www.britishairways.com

-------------------------------------------------------------------------------------------------
21st century air travel     http://www.britishairways.com

---

From: "Timothy Hahn" <[email-masked]>
Date: Thu, 21 Jun 2001 08:36:27 -0400

Dominic,

You have it.  Section 4.1.6 of RFC 2251 clarifies the encoding of 
attribute values when transfered over the LDAP protocol.

Regads,
Tim Hahn

Internet: [email-masked]
Internal: Timothy Hahn/Endicott/IBM@IBMUS or IBMUSM00(HAHNT)
phone: 607.752.6388     tie-line: 8/852.6388
fax: 607.752.3681

"Steinitz, Dominic J" <[email-masked]>
06/21/2001 11:41 AM

        To:     ietf-ldapext <[email-masked]>
        cc: 
        Subject:        BER and Attribute Syntax

I hope this is the right mailing list for asking these sort of questions. 
If not can someone please direct me to the correct one.

According to BER, the decimal number 1321should be encoded as Universal 
Primitive 2 1321= [2,2,5,41] but according to the attribute syntax 
definitions RFC2252 6.16, INTEGER attributes are encoded as a string of 
the decimal representation. So to encode an ASN.1 INTEGER we should use 
BER but to encode an INTEGER attribute we should produce an OctetString of 
the decimal value. Is this correct?

Dominic.

---

From: "Steven Legg" <[email-masked]>
Date: Fri, 22 Jun 2001 11:34:53 +1000

Dominic,

> -----Original Message-----
> From: Steinitz, Dominic J
> [mailto:[email-masked]]
> Sent: Thursday, 21 June 2001 21:41
> To: ietf-ldapext
> I hope this is the right mailing list for asking these sort
> of questions. If not can someone please direct me to the correct one.
>
> According to BER, the decimal number 1321should be encoded as
> Universal Primitive 2 1321= [2,2,5,41] but according to the
> attribute syntax definitions RFC2252 6.16, INTEGER attributes
> are encoded as a string of the decimal representation. So to
> encode an ASN.1 INTEGER we should use BER but to encode an
> INTEGER attribute we should produce an OctetString of the
> decimal value. Is this correct?

If by "an OctetString of the decimal value" you mean the four octets
with the decimal values 49, 51, 50 and 49, being the ASCII codes for
the characters `1', `3', `2' and `1' respectively, then the answer
is yes.

If you mean the two octets with the decimal values 5 and 41 then the
answer is no.

If the attribute value is instead transfered according to the LDAP ";binary"
attribute option (see RFC 2251) then the LDAP AttributeValue OCTET STRING
would contain the four octets with the decimal values 2, 2, 5 and 41
(i.e. a BER encoding stuffed into an ASN.1 OCTET STRING as the content).

Regards,
Steven

---

From: "Skovgaard, Erik" <[email-masked]>
Date: Thu, 21 Jun 2001 19:01:02 -0700

Dominic,

You are right about the BER encoding of the integer values, but this is only
used on DAP, DSP and DISP.  In LDAP we use the string representation; i.e.
it is sent across as the visual decimal representation "1321".  It makes it
easier to read the trace with a protocol analyzer.

Cheers,                     ....Erik.

Erik Skovgaard
Siemens Meta-Directory Solutions
Phone: +1 604-204-0750
Fax:   +1 604-204-0760

-----Original Message-----
From: Steinitz, Dominic J [mailto:[email-masked]]
Sent: Thursday, June 21, 2001 04:41
To: ietf-ldapext
Subject: BER and Attribute Syntax

I hope this is the right mailing list for asking these sort of questions. If
not can someone please direct me to the correct one.

According to BER, the decimal number 1321should be encoded as Universal
Primitive 2 1321= [2,2,5,41] but according to the attribute syntax
definitions RFC2252 6.16, INTEGER attributes are encoded as a string of the
decimal representation. So to encode an ASN.1 INTEGER we should use BER but
to encode an INTEGER attribute we should produce an OctetString of the
decimal value. Is this correct?

Dominic.

----------------------------------------------------------------------------
---------------------
21st century air travel     http://www.britishairways.com

----------------------------------------------------------------------------
---------------------
21st century air travel     http://www.britishairways.com