mirror of
https://github.com/go-i2p/go-i2p.git
synced 2025-07-05 22:17:04 -04:00
fix router_info signature size
This commit is contained in:
@ -204,13 +204,15 @@ func (router_info RouterInfo) Options() (mapping Mapping) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Return the 40 bytes that follow the Mapping in the RouterInfo.
|
// Return the signature of this router info
|
||||||
//
|
//
|
||||||
func (router_info RouterInfo) Signature() (signature Signature) {
|
func (router_info RouterInfo) Signature() (signature Signature) {
|
||||||
head := router_info.optionsLocation()
|
head := router_info.optionsLocation()
|
||||||
size := head + router_info.optionsSize()
|
size := head + router_info.optionsSize()
|
||||||
// TODO: signature is not always 40 bytes, is 40 bytes for DSA only
|
ident, _ := router_info.RouterIdentity()
|
||||||
signature = Signature(router_info[size : size+40])
|
keyCert := KeyCertificate(ident)
|
||||||
|
sigSize := keyCert.SignatureSize()
|
||||||
|
signature = Signature(router_info[size : size+sigSize])
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user