#10 Use XML C14n canonical form for all outgoing messages

已关闭
stan4 年之前创建 · 2 条评论

The XML signature applies to the XML message in its C14n Canonical Form. We might as well make sure that the message templates already are in this form, to ease the signing process.

This does not guarantee that incoming messages will be in canonical form, however, so their should be a way to convert any message to its canonical form.

If this proves too difficult, we might as well rely on lxml for this process. I want to see whether we can do without this extra decode-encode step.

The XML signature applies to the XML message in its C14n Canonical Form. We might as well make sure that the message templates already are in this form, to ease the signing process. This does not guarantee that incoming messages will be in canonical form, however, so their should be a way to convert any message to its canonical form. If this proves too difficult, we might as well rely on `lxml` for this process. I want to see whether we can do without this extra decode-encode step.
Stan Janssen 评论于 4 年之前
所有者

Excellent write-up of the required steps to normalization: https://www.di-mgt.com.au/xmldsig-c14n.html

Excellent write-up of the required steps to normalization: https://www.di-mgt.com.au/xmldsig-c14n.html
Stan Janssen 评论于 4 年之前
所有者

So this turns out to be more of a hassle than I thought. Also, the standard-library xml.etree.ElementTree module contains a canonicalize method that takes a string and produces the canonical output without constructing an XML tree, which looks like what we need. Let's use that.

So this turns out to be more of a hassle than I thought. Also, the standard-library `xml.etree.ElementTree` module contains a `canonicalize` method that takes a string and produces the canonical output without constructing an XML tree, which looks like what we need. Let's use that.
stan4 年之前 关闭
登录 并参与到对话中。
未选择标签
未选择里程碑
未指派成员
1 名参与者
正在加载...
取消
保存
这个人很懒,什么都没留下。