Add correct DS key tag generation

This commit is contained in:
Martin Lensment 2014-12-04 12:56:10 +02:00
parent d39ed1b0e9
commit 11f0b2685e
3 changed files with 25 additions and 3 deletions

View file

@ -258,8 +258,8 @@ class Domain < ActiveRecord::Base
res = ''
parts = name.split('.')
parts.each do |x|
res += sprintf('%02X', x.length)
res += x.each_byte.map { |b| sprintf('%02X', b) }.join
res += sprintf('%02X', x.length) # length of label in hex
res += x.each_byte.map { |b| sprintf('%02X', b) }.join # label
end
res += '00'