double ratchet first implementation
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
ycc
2026-03-04 22:30:22 +01:00
parent c0dcfe997c
commit f4fb42d72e
11 changed files with 375 additions and 14 deletions

View File

@@ -907,6 +907,8 @@ type ContactCard struct {
Version uint32 `protobuf:"varint,7,opt,name=version,proto3" json:"version,omitempty"`
InvitationId string `protobuf:"bytes,8,opt,name=invitation_id,json=invitationId,proto3" json:"invitation_id,omitempty"`
InvitationMessage string `protobuf:"bytes,9,opt,name=invitation_message,json=invitationMessage,proto3" json:"invitation_message,omitempty"`
DrRootKey string `protobuf:"bytes,10,opt,name=dr_root_key,json=drRootKey,proto3" json:"dr_root_key,omitempty"` // DR pre-shared root key (base64, 32 bytes)
DrPublicKey string `protobuf:"bytes,11,opt,name=dr_public_key,json=drPublicKey,proto3" json:"dr_public_key,omitempty"` // DR DH public key of the initiator (base64)
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@@ -1004,6 +1006,20 @@ func (x *ContactCard) GetInvitationMessage() string {
return ""
}
func (x *ContactCard) GetDrRootKey() string {
if x != nil {
return x.DrRootKey
}
return ""
}
func (x *ContactCard) GetDrPublicKey() string {
if x != nil {
return x.DrPublicKey
}
return ""
}
// structure for sending a message to be forwarded to another user in protobuf format
type PackedUserMessage struct {
state protoimpl.MessageState `protogen:"open.v1"`
@@ -1012,6 +1028,7 @@ type PackedUserMessage struct {
Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` // the payload signature with the client identity private key
ServerTimestamp []int64 `protobuf:"varint,4,rep,packed,name=server_timestamp,json=serverTimestamp,proto3" json:"server_timestamp,omitempty"` // server time stamp, might be several in matriochka mode
ServerDeliveryUuid string `protobuf:"bytes,5,opt,name=server_delivery_uuid,json=serverDeliveryUuid,proto3" json:"server_delivery_uuid,omitempty"` // message uuid, for server delivery tracking, omitted if not delivery tracking desired
DrHeader []byte `protobuf:"bytes,6,opt,name=dr_header,json=drHeader,proto3" json:"dr_header,omitempty"` // serialized doubleratchet MessageHeader; empty = no DR layer
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@@ -1081,6 +1098,13 @@ func (x *PackedUserMessage) GetServerDeliveryUuid() string {
return ""
}
func (x *PackedUserMessage) GetDrHeader() []byte {
if x != nil {
return x.DrHeader
}
return nil
}
type ConversationStatus struct {
state protoimpl.MessageState `protogen:"open.v1"`
Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` // uuid of message, or uuid of related message if uuid_action is not empty
@@ -1888,7 +1912,7 @@ const file_messages_proto_rawDesc = "" +
"\x03url\x18\x04 \x01(\tR\x03url\x12\x14\n" +
"\x05login\x18\x05 \x01(\tR\x05login\x12\x1a\n" +
"\bpassword\x18\x06 \x01(\tR\bpassword\x12\x1c\n" +
"\tsignature\x18\a \x01(\tR\tsignature\"\xf8\x02\n" +
"\tsignature\x18\a \x01(\tR\tsignature\"\xbc\x03\n" +
"\vContactCard\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name\x12,\n" +
"\x12contact_public_key\x18\x02 \x01(\tR\x10contactPublicKey\x122\n" +
@@ -1898,13 +1922,17 @@ const file_messages_proto_rawDesc = "" +
"\fpull_servers\x18\x06 \x03(\v2\x13.meowlib.ServerCardR\vpullServers\x12\x18\n" +
"\aversion\x18\a \x01(\rR\aversion\x12#\n" +
"\rinvitation_id\x18\b \x01(\tR\finvitationId\x12-\n" +
"\x12invitation_message\x18\t \x01(\tR\x11invitationMessage\"\xca\x01\n" +
"\x12invitation_message\x18\t \x01(\tR\x11invitationMessage\x12\x1e\n" +
"\vdr_root_key\x18\n" +
" \x01(\tR\tdrRootKey\x12\"\n" +
"\rdr_public_key\x18\v \x01(\tR\vdrPublicKey\"\xe7\x01\n" +
"\x11PackedUserMessage\x12 \n" +
"\vdestination\x18\x01 \x01(\tR\vdestination\x12\x18\n" +
"\apayload\x18\x02 \x01(\fR\apayload\x12\x1c\n" +
"\tsignature\x18\x03 \x01(\fR\tsignature\x12)\n" +
"\x10server_timestamp\x18\x04 \x03(\x03R\x0fserverTimestamp\x120\n" +
"\x14server_delivery_uuid\x18\x05 \x01(\tR\x12serverDeliveryUuid\"\xd7\x02\n" +
"\x14server_delivery_uuid\x18\x05 \x01(\tR\x12serverDeliveryUuid\x12\x1b\n" +
"\tdr_header\x18\x06 \x01(\fR\bdrHeader\"\xd7\x02\n" +
"\x12ConversationStatus\x12\x12\n" +
"\x04uuid\x18\x01 \x01(\tR\x04uuid\x12\x1f\n" +
"\vuuid_action\x18\x02 \x01(\x05R\n" +