Open ghost opened 8 years ago
Same here. I tried to set the mediaKey to be the same as the original message mediaKey, but I guess that's not enough. Maybe the only way round is to download it and then re-upload it...
I'm not able to send encrypted media yet and so forward function doesn't works for encrypted media.
Reupload in plain mode could be a solution but I'm trying to enable media encryption. I've some improvements in the master but still WIP.
I gratefully accept comments and PR.
Maybe the reason forwarding an encrypted media doesn't work is that it's encrypted using the senders public key. So by forwarding the encrypted media we send an invalid message that can't be decrypted by the recipient. This can be verified by having 2 different yowsup clients- one forwards an encrypted media to the other. If the other yowsup gets the contents of the original encrypted media it'll try to decrypt it and maybe will log the error. If this is really the case then 'messageProtocolEntity.forward' need to have a check if there is an encrypted media and decrypt-re encrypt it, then forward it.
@yairh it isn't true. Encrypted media file is encrypted with a shared key sent in the message. And the message is encrypted with correct keys. However, protofuf arrives corrupted. I'm WIP.
@jlguardi this shared key is the media_key
field?
@mniak yes, it is.
I've kinda fixed it in tgalal/yowsup pull request 2027.
In reality I still can't send messages, but the EchoLayer
is now working to me.
I've added some missing media_layer
parsing capabilities on the layer_receive
and some serialization logic for this field also.
When trying to forward encrypted image using echoClient, we get the following error: Message com.whatsapp.proto.Message is missing required fields: image_message.media_key
Full log:
Echoing image https://mmi723.whatsapp.net/d/xMfjotZQ1w0QQzeepVOCbFb_6iM/AnOSQ48R3t2NpFSAs-JzHoi82dF98gogwdgQX01R86dp.enc to 97XXXXXXXX65 WARNING:yowsup.layers.axolotl.layer:Message com.whatsapp.proto.Message is missing required fields: image_message.media_key DEBUG:yowsup.layers.logger.layer:tx:
DEBUG:yowsup.layers.logger.layer:rx:
and retries...