diff --git a/TODO b/TODO index 345a96c5..71312913 100644 --- a/TODO +++ b/TODO @@ -4,7 +4,7 @@ Short term: * Parsing from strings, going with goyacc and own lexer -- develop this in its own package, then fold back to dns package? * private key to privkey format 1.3, io.Writer kind of stuff -* Signature generation +* Signature generation - needs testing * Testsuite - make it slightly better * Cleanup the code diff --git a/keygen.go b/keygen.go index c5d2225c..e27d2a0d 100644 --- a/keygen.go +++ b/keygen.go @@ -40,12 +40,16 @@ func (r *RR_DNSKEY) Generate(bits int) (PrivateKey, os.Error) { if err != nil { return nil, err } - keybuf := make([]byte, 1) + keybuf := make([]byte, 2) if priv.PublicKey.E < 256 { - keybuf[0] = uint8(priv.PublicKey.E) + println(priv.PublicKey.E) + keybuf[0] = 1 + keybuf[1] = uint8(priv.PublicKey.E) } else { keybuf[0] = 0 + //keybuf[1] = part of length + //keybuf[2] = rest of length // keybuf[1]+[2] have the length // keybuf[3:..3+lenght] have exponent // not implemented