xmldsig 0.0.4 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,7 @@ module Xmldsig
7
7
  end
8
8
 
9
9
  def validate(certificate = nil, &block)
10
- signatures.all? { |signature| signature.valid?(certificate, &block) }
10
+ signatures.any? && signatures.all? { |signature| signature.valid?(certificate, &block) }
11
11
  end
12
12
 
13
13
  def sign(private_key = nil, &block)
@@ -1,3 +1,3 @@
1
1
  module Xmldsig
2
- VERSION = "0.0.4"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -36,6 +36,11 @@ describe Xmldsig::SignedDocument do
36
36
  it "returns false if the certificate is not valid" do
37
37
  signed_document.validate(other_certificate).should be_false
38
38
  end
39
+
40
+ it "returns false if there are no signatures and validation is strict" do
41
+ xml_without_signature = Xmldsig::SignedDocument.new('<foo></foo>')
42
+ xml_without_signature.validate(certificate).should be_false
43
+ end
39
44
 
40
45
  it "accepts a block" do
41
46
  signed_document.validate do |signature_value, data|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xmldsig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-01 00:00:00.000000000 Z
12
+ date: 2013-06-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri