Fix digest field name

This commit is contained in:
Martin Lensment 2014-10-14 11:14:16 +03:00
parent 22a3f3c1a7
commit 7a647682df
2 changed files with 8 additions and 8 deletions

View file

@ -171,18 +171,18 @@ module Epp::DomainsHelper
unless domain
epp_errors << {
code: '2303',
msg: I18n.t('errors.messages.epp_domain_not_found'),
value: { obj: 'name', val: @ph[:name] }
code: '2303',
msg: I18n.t('errors.messages.epp_domain_not_found'),
value: { obj: 'name', val: @ph[:name] }
}
return nil
end
if domain.registrar != current_epp_user.registrar && secure[:secure] == true
epp_errors << {
epp_errors << {
code: '2302',
msg: I18n.t('errors.messages.domain_exists_but_belongs_to_other_registrar'),
value: { obj: 'name', val: @ph[:name] }
msg: I18n.t('errors.messages.domain_exists_but_belongs_to_other_registrar'),
value: { obj: 'name', val: @ph[:name] }
}
return nil
end

View file

@ -8,7 +8,7 @@ class Dnskey < ActiveRecord::Base
validate :validate_protocol
validate :validate_flags
before_save -> { generate_digest unless digest.present? }
before_save -> { generate_digest unless ds_digest.present? }
ALGORITHMS = %w(3 5 6 7 8 252 253 254 255)
PROTOCOLS = %w(3)
@ -61,7 +61,7 @@ class Dnskey < ActiveRecord::Base
hex = [domain.name_in_wire_format, flags_hex, protocol_hex, alg_hex, public_key_hex].join
bin = self.class.hex_to_bin(hex)
self.digest = Digest::SHA256.hexdigest(bin).upcase
self.ds_digest = Digest::SHA256.hexdigest(bin).upcase
end
def public_key_hex