Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPP_TAG_EXTENSION is not implemented correctly #80

Closed
michaelrsweet opened this issue Mar 22, 2024 · 1 comment
Closed

IPP_TAG_EXTENSION is not implemented correctly #80

michaelrsweet opened this issue Mar 22, 2024 · 1 comment
Assignees
Labels
bug Something isn't working priority-high
Milestone

Comments

@michaelrsweet
Copy link
Member

Originally reported by Alexander Pevzner on the printing-architecture list...

IPP_TAG_EXTENSION is used to indicate value tags greater than 127. While these have never seen usage in the wild (whether standards-based or for a vendor implementartion), the current CUPS code will incorrectly place the vendor tag outside the value, causing all sorts of problems. Instead, tag 0x7f should just be a binary value whose first four bytes make a big-endian integer holding the extension tag value.

@michaelrsweet michaelrsweet self-assigned this Mar 22, 2024
@michaelrsweet michaelrsweet added bug Something isn't working priority-high labels Mar 22, 2024
@michaelrsweet michaelrsweet added this to the v3.0 milestone Mar 22, 2024
@michaelrsweet
Copy link
Member Author

[master bf38abb] Fix encoding of extension values (Issue #80)

Changes are basically to just pack the whole extension value as a binary string, and to make the ippGet/SetOctetString functions support reading/setting the value. You can't directly add an extension value, you need to first create an octetString and then set the value tag, e.g.:

ipp_attribute_t *attr = ippAddOctetString(ipp, IPP_TAG_..., "name", data, datalen);
ippSetValueTag(ipp, &attr, IPP_TAG_EXTENSION);

Copying the value also works.

Note: There are no known implementations that use extension values, so this is more to ensure that CUPS can handle them properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority-high
Projects
None yet
Development

No branches or pull requests

1 participant