From 3e9677f00a09d0249713ed2fa503e42b07f6d978 Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Tue, 29 Dec 2009 15:27:54 +0100 Subject: Feature #2839 - fingerprint certificate This patch adds several things: * certificate fingerprinting in --list mode * a puppetca action called "--fingerprint" to display fingerprints of given certificates (or all including CSR) * a --fingerprint puppetd option to display client certificates * each time a CSR is generated, its fingerprint is displayed in the log It is also possible to use --digest in puppetca and puppetd to specify a specific digest algorithm. Signed-off-by: Brice Figureau --- spec/unit/application/puppetca.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'spec/unit/application/puppetca.rb') diff --git a/spec/unit/application/puppetca.rb b/spec/unit/application/puppetca.rb index 3a535f394..132a03c1f 100644 --- a/spec/unit/application/puppetca.rb +++ b/spec/unit/application/puppetca.rb @@ -39,6 +39,12 @@ describe "PuppetCA" do @puppetca.handle_debug(0) end + it "should set the fingerprint digest with the --digest option" do + @puppetca.handle_digest(:digest) + + @puppetca.digest.should == :digest + end + it "should set mode to :destroy for --clean" do @puppetca.handle_clean(0) @puppetca.mode.should == :destroy @@ -129,6 +135,15 @@ describe "PuppetCA" do @puppetca.main end + it "should send the currently set digest" do + ARGV.stubs(:collect).returns(["host"]) + @puppetca.handle_digest(:digest) + + @ca.expects(:apply).with { |mode,to| to[:digest] == :digest} + + @puppetca.main + end + it "should delegate to ca.apply with current set mode" do @puppetca.mode = "currentmode" ARGV.stubs(:collect).returns(["host"]) -- cgit