r4sas / PBinCLI

PrivateBin CLI on python 3
MIT License
66 stars 25 forks source link

Simple text file examples fail #1

Closed sferich888 closed 6 years ago

sferich888 commented 7 years ago

From the ReadME:

# python pbincli.py send -f tmp/file.txt -c "test" -d

It produces the following:

eJwrSS0uAQAEXQHB

Passphrase: riHS4TPUheZiJP/OMCO5T7/SL1zkcSRPVInCvDz1+X8=
Password:   riHS4TPUheZiJP/OMCO5T7/SL1zkcSRPVInCvDz1+X8=
Filename:   file.txt
MIME-type:  text/plain
Request:    {'attachmentname': '{"ks":256,"cipher":"aes","mode":"gcm","v":1,"adata":"","ct":"yPkdlUVnxvw5X3f5WHL4bmks6GqrpLJZwumXWkoTDaj95uN+zOt0Rg==","salt":"PT9FcVWM6Qg=","ts":128,"iter":10000,"iv":"sdgZHAy0O1UHG1hgAGs3TA=="}', 'burnafterreading': 0, 'expire': '1day', 'attachment': '{"ks":256,"cipher":"aes","mode":"gcm","v":1,"adata":"","ct":"5Zk9AG+1mO2KHCqIkSyuxlaTZyU+i7TA32OyKXyFwlyDjQ1odcCosaN1hAdhJS5/8yfOGKsZHUCJCkDP7BkOv98gliGEiQ869VnArseChNqzx/5zP4lky/qq2m/RPp2l","salt":"PT9FcVWM6Qg=","ts":128,"iter":10000,"iv":"Yc0MvHMzgJJ8kqUE7EM3lw=="}', 'opendiscussion': 0, 'formatter': 'plaintext', 'data': '{"ks":256,"cipher":"aes","mode":"gcm","v":1,"adata":"","ct":"5VMJxVfYVTwIY0Sg75wytXbDcnHn+OidZ1dCIGJKTiA=","salt":"PT9FcVWM6Qg=","ts":128,"iter":10000,"iv":"j6+QiL0BrSoXqULyf/4i/g=="}'}
Response:   {"status":1,"message":"Invalid attachment."}

Something went wrong...
Error:      Invalid attachment.

It seems that the issue is caused, on due to server checks with the following code: https://github.com/PrivateBin/PrivateBin/blob/master/lib/Model/Paste.php#L183-L211

So I am not sure if this issue should be filed with https://github.com/PrivateBin/PrivateBin/issues or not ?

sferich888 commented 7 years ago

Server side version is: 1.1