Skip to content

Commit

Permalink
Fix ciphertext validation
Browse files Browse the repository at this point in the history
  • Loading branch information
neekolas committed Oct 24, 2023
1 parent 6b57691 commit cd38308
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/api/message/v3/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,9 @@ func validatePublishWelcomesRequest(req *proto.PublishWelcomesRequest) error {
if welcome == nil || welcome.WelcomeMessage == nil {
return status.Errorf(codes.InvalidArgument, "invalid welcome message")
}
ciphertext := welcome.WelcomeMessage.GetV1().Ciphertext
if len(ciphertext) == 0 {

v1 := welcome.WelcomeMessage.GetV1()
if v1 == nil || len(v1.Ciphertext) == 0 {
return status.Errorf(codes.InvalidArgument, "invalid welcome message")
}
}
Expand Down

0 comments on commit cd38308

Please sign in to comment.