mirror of
https://github.com/go-i2p/go-i2p.git
synced 2025-07-13 11:54:46 -04:00
tweaks
This commit is contained in:
@ -73,17 +73,18 @@ func createValidKeyAndCert(t *testing.T) *KeysAndCert {
|
||||
t.Fatalf("Failed to create certificate: %v\n", err)
|
||||
}
|
||||
|
||||
key_cert := key_certificate.KeyCertificateFromCertificate(*cert)
|
||||
|
||||
keyCert := key_certificate.KeyCertificateFromCertificate(*cert)
|
||||
pubKeySize := keyCert.CryptoSize()
|
||||
sigKeySize := keyCert.SignatureSize()
|
||||
paddingSize := KEYS_AND_CERT_DATA_SIZE - pubKeySize - sigKeySize
|
||||
// Generate random padding
|
||||
paddingSize := KEYS_AND_CERT_DATA_SIZE - KEYS_AND_CERT_PUBKEY_SIZE - KEYS_AND_CERT_SPK_SIZE
|
||||
padding := make([]byte, paddingSize)
|
||||
_, err = rand.Read(padding)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
keysAndCert, err := NewKeysAndCert(key_cert, elg_pubkey, padding, ed25519_pubkey)
|
||||
keysAndCert, err := NewKeysAndCert(keyCert, elg_pubkey, padding, ed25519_pubkey)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
@ -100,8 +100,8 @@ func TestCreateRouterInfo(t *testing.T) {
|
||||
keyCert := key_certificate.KeyCertificateFromCertificate(*cert)
|
||||
pubKeySize := keyCert.CryptoSize()
|
||||
sigKeySize := keyCert.SignatureSize()
|
||||
expectedPaddingSize := keys_and_cert.KEYS_AND_CERT_DATA_SIZE - pubKeySize - sigKeySize
|
||||
padding := make([]byte, expectedPaddingSize)
|
||||
paddingSize := keys_and_cert.KEYS_AND_CERT_DATA_SIZE - pubKeySize - sigKeySize
|
||||
padding := make([]byte, paddingSize)
|
||||
_, err = rand.Read(padding)
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to generate random padding: %v\n", err)
|
||||
|
Reference in New Issue
Block a user