LibreSign / libresign

✍️ Nextcloud app to sign PDF documents
https://libresign.coop
GNU Affero General Public License v3.0
452 stars 51 forks source link

Invalid password #2505

Closed tasagore closed 3 months ago

tasagore commented 4 months ago

Hi

I've upgraded from RC5 to RC7 and still every time I try to sign a file I get the invalid password error and it's right. Tested in two instances (same server).

I thought this was fixed, isn't it?

Regards

JeffStarkman commented 4 months ago

First, thanks for the good work!

Nextcloud 28.0.3, PHP 8.2. LibreSign rc6 / rc7 I have the same problem. I created a certificate with: user - libresign - settings - create certificate. After creation, I change the password 2 times to see if I use the correct password. this works.

Now try to sign a pdf, i get always the message "wrong password".

Second try, I import a certificate file "mycert.pfx" with a known password, I get the same error.

Greetings

JeffStarkman commented 4 months ago

Additional Information, I found this error in my nextcloud Log:

[PHP] Fehler: Undefined array key "profileElementId" at /var/www/nextcloud/apps/libresign/lib/Helper/ValidateHelper.php#306 POST /ocs/v2.php/apps/libresign/api/v1/sign/uuid/e9e23453-ff3c-4fe3-9373-3c77a5bf51bd

vitormattos commented 3 months ago

@JeffStarkman could you provide the scenario to reproduce this problem? Looking at the code, this isn't related with password and I can't create a scenario to reproduce your report.

JeffStarkman commented 3 months ago

grafik

grafik

grafik

Error in the right upper corner:

grafik

grafik

Greetings

tasagore commented 3 months ago

@JeffStarkman could you provide the scenario to reproduce this problem? Looking at the code, this isn't related with password and I can't create a scenario to reproduce your report.

Hi @vitormattos , since you can't create a scenario to reproduce it and a few of us have the same problem I can setup a VM with all stuff installed and give you access or send you a link to download the entire VM and make your own test locally if it helps.

vitormattos commented 3 months ago

Hi @tasagore I'm making improvements at flow to generate root certificate and also to generate the signer certificate here:

It might be a good idea to wait for these improvements to be completed as I won't be able to test in another environment at the moment.

If the problem persists on your side after this pull request, I will be very happy to be able to reproduce the steps in an environment where the problem is occurring.

We are currently in need of financing for the project to be able to pay for the development as today the project does not have the funds to maintain itself financially.

vitormattos commented 3 months ago

@tasagore and @JeffStarkman I published now the RC-8 with a lot of improvements at certificates. Could test again? I recommend to generate a new root cert because I made changes at root cert generation too.

JeffStarkman commented 3 months ago

I have tested again (rc8), with the following steps:

=> same error

back to settings, I take a look at my certificate and also try to change my password:

=> ok

=> ok

=> ok

my settings with openssl: grafik

warnings in log: [PHP] Fehler: Undefined array key "OU" at /var/www/nextcloud/apps/libresign/lib/Handler/CertificateEngine/AEngineHandler.php#138 POST /ocs/v2.php/apps/libresign/api/v1/account/pfx/read

i didnt fillout the field "OU", so maybe this error is not important

nextsteps for me,

=> same error

next try, make updates (most php8.2), uninstall libresign, reboot and install libresign again:

=> same error

I found a new error in log: [PHP] Fehler: fsockopen(): Unable to connect to 127.0.0.1:8888 (Connection refused) at /var/www/nextcloud/apps/libresign/lib/Handler/CertificateEngine/CfsslHandler.php#269 GET /apps/files

short story: in settings and personel settings I can change / create certificate and passwords, every thing works.

Remark: if I read my certificate and type a wrong password, I get no msg Password wrong, I have to close the small window grafik (the circle dont stop rotating)

an type it again.

only in the last step signing the document, it won't work.

helpfull was the new "read certificate" button to check the password!

Greetings

tasagore commented 3 months ago

@vitormattos same with RC8, invalid password. I've deleted the root cert, the personal cert, change passwords...no way, always same error.

NC Logs:

image

vitormattos commented 3 months ago

Hi @tasagore could you provide the entire row log of this entry? The backtrace could help to identify what happening.

tasagore commented 3 months ago

Entire row log? Do you mean the nextcloud.log content?

vitormattos commented 3 months ago

No, only the rows of the errors that stays in your print screen.

vitormattos commented 3 months ago

Maybe was resolved by:

Wait next release candidate

vitormattos commented 3 months ago

[PHP] Fehler: Undefined array key "profileElementId" at /var/www/nextcloud/apps/libresign/lib/Helper/ValidateHelper.php#306 POST /ocs/v2.php/apps/libresign/api/v1/sign/uuid/e9e23453-ff3c-4fe3-9373-3c77a5bf51bd

Fixed by:

vitormattos commented 3 months ago

Fixed at https://github.com/LibreSign/libresign/releases/download/v8.0.0-rc9/libresign-v8.0.0-rc9.tar.gz

JeffStarkman commented 3 months ago

works also for me after installed version rc9:

after insert password a get an error in the upper right corner:

The chosen hash algorithm (SHA-1) requires a newer PDF version (PDF-1.3) than the original (PDF-1.2).
THe PDF version update is impossible in the "append" signature mode.
Either disable the append mode or pick another hash algorithm.
These are the algorithm requirements: SHA-1 (PDF-1.3, SHA-256 (PDF-1.6), SHA-384 (PDF-1.7), SHA-512 (PDF-1.7), RIPEMD160 (PDF-1.7)

=> IT WORKS!

vitormattos commented 3 months ago

Hi @JeffStarkman this is an error message from JSignPdf that haven't support to PDF-1.2

I prefixed this message by:

Error at JSignPdf side. LibreSign can not do nothing. Follow the error message: