Skip to content

Commit 968d204

Browse files
committed
check if file is encrypted
1 parent ba2c47e commit 968d204

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

zboxcore/sdk/sharerequest.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ func (req *ShareRequest) getAuthTicket(clientID, encPublicKey string) (*marker.A
7373
at.Expiration = at.Timestamp + req.expirationSeconds
7474
}
7575

76-
if encPublicKey != "" { // file is encrypted
76+
if fRef.EncryptedKey != "" { // file is encrypted
77+
if encPublicKey == "" {
78+
return nil, errors.New("empty_key", "encryption public key cannot be empty for sharing encrypted files")
79+
}
7780
encScheme := encryption.NewEncryptionScheme()
7881
var entropy string
7982
if fRef.EncryptionVersion == SignatureV2 {

0 commit comments

Comments
 (0)