Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix newline bug by escaping LF and CR in message
in-toto has new error messages that contain newline characters. When relaying these messages to apt the text-based protocol breaks. We fix this by escaping any newline character in the message. NOTE: The apt method interface spec references RFC822, which doesn't allow LF or CR in the message body, except if followed by a LWSP-char (i.e. SPACE or HTAB, for "folding" of long lines). But apt does not seem to support folding, and splits lines only at LF. To be safe we escape LF and CR. See 2.1 Overview in www.fifi.org/doc/libapt-pkg-doc/method.html/ch2.html See "3.1.1. LONG HEADER FIELDS" and "3.1.2. STRUCTURE OF HEADER FIELDS" in www.ietf.org/rfc/rfc822.txt
- Loading branch information