Skip to contentSkip to conversation

CUPS & IPP_TAG_EXTENSION

DISCUSSION Alexander Pevzner 2 participants 3 messages Mar 22, 2024

lore
Share & tools
lore
#0 lore raw

Hi Everybody,

yet another question regarding IPP.

In RFC8010, it is stated that IPP_TAG_EXTENSION is encoded similarly to any other tag: starting with 1 byte of tag (0x7f), followed by the attribute name, and then the attribute value. However, the RFC specifies that the first 4 bytes of the value should be reserved to encode 4 bytes of an extended tag.

On the other hand, the CUPS implementation encodes 0x7f, followed by 4 bytes of the extended tag, and then the attribute name and value.

So, the question arises: which approach is correct, CUPS or the RFC?

Signature · 1 line
	Wishes, Alexander Pevzner ([email protected])
#1 lore raw

Alexander,

Quoted 7 lines · Alexander Pevzner

Hi Everybody,

yet another question regarding IPP.

In RFC8010, it is stated that IPP_TAG_EXTENSION is encoded similarly to any other tag: starting with 1 byte of tag (0x7f), followed by the attribute name, and then the attribute value. However, the RFC specifies that the first 4 bytes of the value should be reserved to encode 4 bytes of an extended tag.

Wow, good catch!

Quoted 3 lines

On the other hand, the CUPS implementation encodes 0x7f, followed by 4 bytes of the extended tag, and then the attribute name and value.

So, the question arises: which approach is correct, CUPS or the RFC?

The RFC. CUPS is broken in this respect, but then there have never been any extended types in standards-track nor vendor implementations that I am aware of, which is probably why we've never had problems... :)

I've created issues to track the fixes:

https://github.com/OpenPrinting/cups/issues/913
https://github.com/OpenPrinting/libcups/issues/80

________________________
Michael Sweet

#2 lore raw

Michael,

Quoted 1 line · Michael Sweet

Wow, good catch!

I actually caught it a while ago, when was actively working on goipp and looked to the CUPS sources to compare both implementations. But forgot to report it in time, sorry for that.

Quoted 1 line

The RFC. CUPS is broken in this respect, but then there have never been any extended types in standards-track nor vendor implementations that I am aware of, which is probably why we've never had problems... :)

This is quite obvious. But if we have this code for some reason, we obviously want it to be correct :)

Signature · 1 line
	Wishes, Alexander Pevzner ([email protected])