mirror of
https://github.com/internetee/registry.git
synced 2025-08-12 12:39:34 +02:00
Fix digest field name
This commit is contained in:
parent
22a3f3c1a7
commit
7a647682df
2 changed files with 8 additions and 8 deletions
|
@ -8,7 +8,7 @@ class Dnskey < ActiveRecord::Base
|
||||||
validate :validate_protocol
|
validate :validate_protocol
|
||||||
validate :validate_flags
|
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)
|
ALGORITHMS = %w(3 5 6 7 8 252 253 254 255)
|
||||||
PROTOCOLS = %w(3)
|
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
|
hex = [domain.name_in_wire_format, flags_hex, protocol_hex, alg_hex, public_key_hex].join
|
||||||
bin = self.class.hex_to_bin(hex)
|
bin = self.class.hex_to_bin(hex)
|
||||||
self.digest = Digest::SHA256.hexdigest(bin).upcase
|
self.ds_digest = Digest::SHA256.hexdigest(bin).upcase
|
||||||
end
|
end
|
||||||
|
|
||||||
def public_key_hex
|
def public_key_hex
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue