Skip to content

Commit dac9654

Browse files
committed
Add support for badAttestationStatement error
1 parent d78e230 commit dac9654

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

lib/acme/client/error.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ class AutoRenewalCancellationInvalid < ServerError; end
9797
class AutoRenewalRevocationNotSupported < ServerError; end
9898
class UnknownDelegation < ServerError; end
9999
class OnionCAARequired < ServerError; end
100+
class BadAttestationStatement < ServerError; end
100101

101102
ACME_ERRORS = {
102103
'urn:ietf:params:acme:error:alreadyReplaced' => AlreadyReplaced,
@@ -130,5 +131,6 @@ class OnionCAARequired < ServerError; end
130131
'urn:ietf:params:acme:error:autoRenewalRevocationNotSupported' => AutoRenewalRevocationNotSupported,
131132
'urn:ietf:params:acme:error:unknownDelegation' => UnknownDelegation,
132133
'urn:ietf:params:acme:error:onionCAARequired' => OnionCAARequired
134+
'urn:ietf:params:acme:error:badAttestationStatement' => BadAttestationStatement,
133135
}
134136
end

lib/acme/client/problem.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ class Acme::Client::Problem
3838
'autoRenewalRevocationNotSupported' => 'A request to revoke an auto-renewal Order has been received',
3939
'unknownDelegation' => 'An unknown configuration is listed in the delegation attribute of the order request',
4040
'onionCAARequired' => 'The CA only supports checking the CAA for Hidden Services in-band, but the client has not provided an in-band CAA',
41-
'alreadyReplaced' => 'The request specified a predecessor certificate that has already been marked as replaced'
41+
'alreadyReplaced' => 'The request specified a predecessor certificate that has already been marked as replaced',
42+
'badAttestationStatement' => 'The attestation statement is unacceptable (e.g. not signed by an attestation authority trusted by the CA)'
4243
}.freeze
4344

4445
def self.from(value)

spec/problem_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@ def normalize_iana_description(description)
206206
end
207207
missing_error_classes = iana_types.map { |type| "#{described_class::ERROR_PREFIX}#{type}" } - Acme::Client::Error::ACME_ERRORS.keys
208208

209+
require 'debug'
210+
debugger
211+
212+
209213
expect(missing_types).to be_empty, "missing registered ACME problem descriptions: #{missing_types.join(', ')}"
210214
expect(extra_types).to be_empty, "extra registered ACME problem descriptions: #{extra_types.join(', ')}"
211215
expect(mismatched_descriptions).to be_empty, "mismatched IANA ACME problem descriptions: #{mismatched_descriptions.inspect}"

0 commit comments

Comments
 (0)