Open ct-clearhaus opened 6 years ago
See https://github.com/clearhaus/pedicel-pay/pull/7 for the adjustment of pedicel-pay
I have in mind 🙂
I think the overwrite: true
parameter makes sense, since this is most likely the use case. I prefer replace
, though.
The case that we want to catch, is if a non Apple-signed signature is added, we don't want to accidentally use that and accept that as a valid signature. But as we already check if we (erroneously) accept a signature with a different root certificate, I don't think a new test is required.
It's renamed to replace
; I merged and made another release of pedicel-pay
🙂
IRL discussion:
.verify_signed_time
.But doesn't "Verify the signature as follows" state that there must be exactly one signer?
Well, not necessarily, since one PKCS7 signature can have multiple signers (cf. https://tools.ietf.org/html/rfc5652#section-5.1).
We could even read it as
If there's just one signer that signed it "within a few minutes", then it's all good.
but we've decided that we accept it only when there's exactly one signer. And since we do this, we could move the check earlier and fail slightly less weird.
This piece of code should be hit by a test no matter what.
A pull request related to this is https://github.com/clearhaus/pedicel/pull/27.
A pull request related to this is #27.
Agreed. However, we still miss a test to hit the code that makes pedicel err when multiple signers is present in the signature.
By adjusting
PedicelPay::Backend#sign
to err if thetoken
already has asignature
, I notice that only 4 specs fail, namelyBut by removing the
if token.signature
section completely makes the specs succeed. Thus, it seems it's not used anywhere thatpedicel-pay
support adding to the PKCS7 signature.I think we should test this. However, I also think the default behaviour in
PedicelPay::Backend#sign
should be to overwrite the signature; there could be aoverwrite: true
default flag.@kse-clearhaus WDYT?