Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

(#13957) Allow to revoke certificates by specifying its serial number #678

Closed
wants to merge 1 commit into from

3 participants

@asquelt

No description provided.

@kelseyhightower

@asquelt Thanks for the patch and we apologize for getting to this so late. Before we can really give this pull request a proper review can you add some tests for this?

@jeffmccune
Owner

@asquelt I'm going to go ahead and close this pull request in favor of PR-1210 since that pull request has tests. Please feel free to re-open this issue if the progress on #PR-1210 is insufficient.

@jeffmccune jeffmccune closed this
@jeffmccune
Owner

Also, I've marked issue #13957 as duplicated by #16798. Progress will continue in 16798 instead of 13957.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 17, 2012
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 4 deletions.
  1. +10 −4 lib/puppet/ssl/certificate_authority.rb
View
14 lib/puppet/ssl/certificate_authority.rb
@@ -229,10 +229,16 @@ def print(name)
def revoke(name)
raise ArgumentError, "Cannot revoke certificates when the CRL is disabled" unless crl
- if cert = Puppet::SSL::Certificate.indirection.find(name)
- serial = cert.content.serial
- elsif ! serial = inventory.serial(name)
- raise ArgumentError, "Could not find a serial number for #{name}"
+ if name =~ /^(0x[0-9a-f]+)$/
+ serial = $1.to_i(16)
+ elsif name =~ /^(\d+)$/
+ serial = $1.to_i(10)
+ else
+ if cert = Puppet::SSL::Certificate.indirection.find(name)
+ serial = cert.content.serial
+ elsif ! serial = inventory.serial(name)
+ raise ArgumentError, "Could not find a serial number for #{name}"
+ end
end
crl.revoke(serial, host.key.content)
end
Something went wrong with that request. Please try again.