letoams / hash-slinger

GNU General Public License v2.0
50 stars 14 forks source link

fix generic TLSA record generation #46

Closed anarcat closed 11 months ago

anarcat commented 11 months ago

It seems like the calculation for the TLSA record never really worked, as we're doing float division here on the len() field. In our case, that field returned 35.0 which is not valid in our environment.

Doing an integer division gives the correct result in most cases, I believe.

Credits go to @jcharaoui who found the bug, diagnosed it to that specific line, and proposed a fix (a int() cast which I turned into integer division instead).

Closes: #45

stoecker commented 11 months ago

Another solution would bit a bit-shift to the right by 1.