Permalink
Browse files

Validation fix

Fail vaidation if there is no signature block at all.
  • Loading branch information...
sanitar committed Mar 22, 2013
1 parent 70d609f commit 51d0effc00f8f27509589392395fc467302a1162
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/xmldsig/signed_document.rb
@@ -7,7 +7,7 @@ def initialize(document, options = {})
end
def validate(certificate = nil, &block)
- signatures.all? { |signature| signature.valid?(certificate, &block) }
+ signatures.empty? ? false : signatures.all? { |signature| signature.valid?(certificate, &block) }
end
def sign(private_key = nil, &block)

0 comments on commit 51d0eff

Please sign in to comment.