Hi Thorsten, On Wed, Aug 16, 2017 at 5:22 AM, Thorsten Behrens <t...@libreoffice.org> wrote:
> Miklos Vajna wrote: > > The idea is that per-paragraph signature should be non-chained, similar > > to per-document signatures, so the Writer field(s) representing the > > signature(s) should be filtered out before hashing, but otherwise this > > just takes the paragraph text as-is. (My understanding is that ODF > > specifies what is the exact paragraph string for a <text:p> element.) > > > Hi Miklos, > > ok - as long as that could be described (or pseudo code given), > that'll do I guess. Just be aware that text:p can still be quite > complex in xml, with whitespace mangling & all sorts of child elements > (see paragraph-content-or-hyperlink / paragraph-content in the > schema). > The code currently in master was a temporary first step. The logic I currently have locally ready to push soon is to only use Text portions. Roughly as follows: OUStringBuffer strBuf; for (auto& portion : paragraphTextPortions) { if (portion.TextPortionType == "Text") strBuf.append(portion.Text); } sign(strBuf.makeStringAndClear()); I expect this should exclude any unwanted fields/characters/LO-specific conversions etc. Let me know if there are concerns with this approach. > > And I wonder if char attribute sets shouldn't be included in the > signature, no idea what funny view vs. content games could be played > otherwise? > > We considered/discussed this, but it quickly became apparent that there are other complications in considering attributes. For now at least we are leaving all formatting/styles out of document signing and only considering the plain text. Thanks
_______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice