summaryrefslogtreecommitdiff
path: root/sample/openssl/certstore.rb
diff options
context:
space:
mode:
authorzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-20 13:41:02 +0000
committerzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-20 13:41:02 +0000
commitb4489ae953601cceb30e5dbdac5fe213ecad1b75 (patch)
tree0e8bea2d6e4a0cdfc900c835653a83a2637ff740 /sample/openssl/certstore.rb
parent368cecc1517ba2a09b0413eeaf5c3ba9981de4db (diff)
* sample/*: whitespace patch by Sergio Campama [Fixes GH-364]
https://github.com/ruby/ruby/pull/364 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample/openssl/certstore.rb')
-rw-r--r--sample/openssl/certstore.rb52
1 files changed, 26 insertions, 26 deletions
diff --git a/sample/openssl/certstore.rb b/sample/openssl/certstore.rb
index c0bc21bcbbb..c6e8f816bcd 100644
--- a/sample/openssl/certstore.rb
+++ b/sample/openssl/certstore.rb
@@ -76,27 +76,27 @@ private
result = @x509store.verify(cert) do |ok, ctx|
cert = ctx.current_cert
if ctx.current_crl
- crl_map[cert.subject] = true
+ crl_map[cert.subject] = true
end
if ok
- if !ctx.current_crl
- if crl = @crl_store.find_crl(cert)
- crl_map[cert.subject] = true
- if crl.revoked.find { |revoked| revoked.serial == cert.serial }
- ok = false
- error_string = 'certification revoked'
- end
- end
- end
+ if !ctx.current_crl
+ if crl = @crl_store.find_crl(cert)
+ crl_map[cert.subject] = true
+ if crl.revoked.find { |revoked| revoked.serial == cert.serial }
+ ok = false
+ error_string = 'certification revoked'
+ end
+ end
+ end
end
error_map[cert.subject] = error_string if error_string
ok
end
error = if result
- nil
- else
- error_map[cert.subject] || @x509store.error_string
- end
+ nil
+ else
+ error_map[cert.subject] || @x509store.error_string
+ end
return error, crl_map
end
@@ -105,13 +105,13 @@ private
cert = generate_cert(certfile)
case guess_cert_type(cert)
when CERT_TYPE_SELF_SIGNED
- @self_signed_ca << cert
+ @self_signed_ca << cert
when CERT_TYPE_OTHER
- @other_ca << cert
+ @other_ca << cert
when CERT_TYPE_EE
- @ee << cert
+ @ee << cert
else
- raise "Unknown cert type."
+ raise "Unknown cert type."
end
end
@c_store.get_crls.each do |crlfile|
@@ -128,21 +128,21 @@ private
# Ignores criticality of extensions. It's 'guess'ing.
case ext.oid
when 'basicConstraints'
- /CA:(TRUE|FALSE), pathlen:(\d+)/ =~ ext.value
- ca = ($1 == 'TRUE') unless ca
+ /CA:(TRUE|FALSE), pathlen:(\d+)/ =~ ext.value
+ ca = ($1 == 'TRUE') unless ca
when 'keyUsage'
- usage = ext.value.split(/\s*,\s*/)
- ca = usage.include?('Certificate Sign') unless ca
+ usage = ext.value.split(/\s*,\s*/)
+ ca = usage.include?('Certificate Sign') unless ca
when 'nsCertType'
- usage = ext.value.split(/\s*,\s*/)
- ca = usage.include?('SSL CA') unless ca
+ usage = ext.value.split(/\s*,\s*/)
+ ca = usage.include?('SSL CA') unless ca
end
end
if ca
if self_signed
- CERT_TYPE_SELF_SIGNED
+ CERT_TYPE_SELF_SIGNED
else
- CERT_TYPE_OTHER
+ CERT_TYPE_OTHER
end
else
CERT_TYPE_EE