mirror of
https://github.com/miekg/dns.git
synced 2025-10-12 18:31:00 +02:00
Fix the keygen alg: fill the correct bytes
This commit is contained in:
parent
15bf984f3f
commit
3e11fafac5
2
TODO
2
TODO
@ -4,7 +4,7 @@ Short term:
|
|||||||
* Parsing from strings, going with goyacc and own lexer
|
* Parsing from strings, going with goyacc and own lexer
|
||||||
-- develop this in its own package, then fold back to dns package?
|
-- develop this in its own package, then fold back to dns package?
|
||||||
* private key to privkey format 1.3, io.Writer kind of stuff
|
* private key to privkey format 1.3, io.Writer kind of stuff
|
||||||
* Signature generation
|
* Signature generation - needs testing
|
||||||
* Testsuite - make it slightly better
|
* Testsuite - make it slightly better
|
||||||
* Cleanup the code
|
* Cleanup the code
|
||||||
|
|
||||||
|
@ -40,12 +40,16 @@ func (r *RR_DNSKEY) Generate(bits int) (PrivateKey, os.Error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
keybuf := make([]byte, 1)
|
keybuf := make([]byte, 2)
|
||||||
|
|
||||||
if priv.PublicKey.E < 256 {
|
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 {
|
} else {
|
||||||
keybuf[0] = 0
|
keybuf[0] = 0
|
||||||
|
//keybuf[1] = part of length
|
||||||
|
//keybuf[2] = rest of length
|
||||||
// keybuf[1]+[2] have the length
|
// keybuf[1]+[2] have the length
|
||||||
// keybuf[3:..3+lenght] have exponent
|
// keybuf[3:..3+lenght] have exponent
|
||||||
// not implemented
|
// not implemented
|
||||||
|
Loading…
x
Reference in New Issue
Block a user