From 3309da8bcd18efd837da2cf86bb7a29bdfd071e2 Mon Sep 17 00:00:00 2001 From: Niko PLP Date: Sun, 25 Jun 2023 16:57:54 +0300 Subject: [PATCH] allowing public IPv6 on private interface, because DMZ can do that --- p2p-repo/src/types.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/p2p-repo/src/types.rs b/p2p-repo/src/types.rs index 76d5df8..dd648cc 100644 --- a/p2p-repo/src/types.rs +++ b/p2p-repo/src/types.rs @@ -14,7 +14,7 @@ //! Corresponds to the BARE schema use crate::errors::NgError; -use crate::utils::{decode_key, dh_pubkey_from_ed_slice}; +use crate::utils::{decode_key, dh_pubkey_from_ed_slice, ed_privkey_to_pubkey}; use core::fmt; use serde::{Deserialize, Serialize}; use serde_bare::to_vec; @@ -124,6 +124,9 @@ impl PrivKey { PrivKey::Ed25519PrivKey(o) => o, } } + pub fn to_pub(&self) -> PubKey { + ed_privkey_to_pubkey(self) + } } impl From<[u8; 32]> for PrivKey {