[PD2] some anotations on what to change in client

This commit is contained in:
Tiago Sousa 2024-05-30 15:49:49 +01:00
parent 8f29d75d27
commit 247d2e73dc
Signed by: tiago
SSH key fingerprint: SHA256:rOmjD81ZIhKdCkFWS9UIKdBi4UByF5x3hRH/0YeXsPI

View file

@ -107,6 +107,7 @@ func sendCommand(clientKeyStore cryptoUtils.KeyStore, plainSubject, plainBody, u
return err return err
} }
// FIX: adapt to api
cl, err := networking.NewClient[protocol.Packet](&clientKeyStore) cl, err := networking.NewClient[protocol.Packet](&clientKeyStore)
if err != nil { if err != nil {
return err return err
@ -117,14 +118,17 @@ func sendCommand(clientKeyStore cryptoUtils.KeyStore, plainSubject, plainBody, u
if err != nil { if err != nil {
return err return err
} }
subject, err := clientKeyStore.EncryptMessageContent(receiverCert, plainSubjectBytes) // NOTE: this will stay the same
subject, err := clientKeyStore.EncryptMessageContent(receiverCert, uid, plainSubjectBytes)
if err != nil { if err != nil {
return err return err
} }
body, err := clientKeyStore.EncryptMessageContent(receiverCert, plainBodyBytes) body, err := clientKeyStore.EncryptMessageContent(receiverCert, uid, plainBodyBytes)
if err != nil { if err != nil {
return err return err
} }
// FIX: adapt to api
sendMsgPacket := protocol.NewSendMsgPacket(uid, subject, body) sendMsgPacket := protocol.NewSendMsgPacket(uid, subject, body)
if err := cl.Connection.Send(sendMsgPacket); err != nil { if err := cl.Connection.Send(sendMsgPacket); err != nil {
return err return err