Permalink
Browse files

Small improvment from Kim-Minh Kaplan

  • Loading branch information...
1 parent 8584a6a commit 86ab3b6e77abe8f7f50082cefa52c92c78d0e1c7 Stephane Bortzmeyer committed Dec 21, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 DNSLG/Formatter.py
View
@@ -27,12 +27,12 @@ def keylength(alg, key):
firstbyte = struct.unpack("B", key[0])[0]
if firstbyte > 0:
exponentlength = firstbyte + 1
- return (len(key)-exponentlength)*8
else:
exponentlength = struct.unpack(">H", key[1:3])[0] + 3
- return (len(key)-exponentlength)*8
+ return (len(key)-exponentlength)*8
else:
- # Unknown, best guess
+ # Unknown, best guess. Read the RFCs 6605 or 5933 to find out
+ # the format of ECDSA or GOST keys.
return len(key)*8
class Formatter():

0 comments on commit 86ab3b6

Please sign in to comment.