feature: Adds signing validation support to the client.
This commit is contained in:
parent
86ad3e174f
commit
00a57443d4
6 changed files with 242 additions and 80 deletions
|
@ -1,6 +1,7 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
|
||||
core "git.greysoh.dev/imterah/bismuthd/commons"
|
||||
|
@ -191,6 +192,7 @@ func (bismuth BismuthServer) HandleProxy(conn net.Conn) error {
|
|||
totalPacketContents[0] = core.GetTrustedDomains
|
||||
|
||||
for index, trustedDomain := range bismuth.TrustedDomains {
|
||||
fmt.Println("building trusted domains")
|
||||
totalPacketContents = append(totalPacketContents, []byte(trustedDomain)...)
|
||||
|
||||
if index+1 != len(bismuth.TrustedDomains) {
|
||||
|
|
|
@ -40,7 +40,7 @@ func (bismuth BismuthServer) decryptMessage(aead cipher.AEAD, encMsg []byte) ([]
|
|||
// Initializes a Bismuth server.
|
||||
//
|
||||
// Both `pubKey` and `privKey` are armored PGP public and private keys respectively.
|
||||
func NewBismuthServer(pubKey string, privKey string, signServers []string, encryptionAlgo int) (*BismuthServer, error) {
|
||||
func New(pubKey string, privKey string, signServers []string, trustedDomains []string, encryptionAlgo int) (*BismuthServer, error) {
|
||||
publicKey, err := crypto.NewKeyFromArmored(pubKey)
|
||||
|
||||
if err != nil {
|
||||
|
@ -59,6 +59,7 @@ func NewBismuthServer(pubKey string, privKey string, signServers []string, encry
|
|||
PublicKey: publicKey,
|
||||
PrivateKey: privateKey,
|
||||
SigningServers: signServers,
|
||||
TrustedDomains: trustedDomains,
|
||||
SymmetricEncryptionAlgorithm: encryptionAlgo,
|
||||
pgp: pgp,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue