[Patch] Clear passwords if authentication fails

Albrecht Dreß <[email protected]>
Newsgroups gmane.comp.gnome.apps.balsa
Message-ID <[email protected]>
Hi all,

currently, when the authentication to a server fails, and if the user decided to remember the password, the password is kept, and the next authentication attempt will again fail.

Attached is a patch which fixes this behaviour by clearing the respective password for the following conditions:
- SMTP: when the server replies with a 534 (Authentication mechanism is too weak) or 535 (Authentication credentials invalid) status code (see RFC 4954, Sect. 6)
- POP3: when any error occurs during the authentication phase, as POP3 has no standardised codes indicating the status as for SMTP
- user certificate private key: when the key decryption fails

Please note that this patch goes on top of the following pending patches:
* “password dialogue improvements”, submitted on November 4th
* “Fix broken IMAP special folders & other migration issues”, submitted on November 5th

As always, any comment is welcome!

Cheers,
Albrecht.

---
Patch details:
- libbalsa/mailbox_pop3.c, libbalsa/send.c: clear appropriate password when libnetclient reports an authentication failure (SMTP, POP), or could not decrypt a user certificate's private key
- libnetclient/net-client-pop.[ch]: report auth failure if the server reports any error in the authentication phase (AUTH, APOP, USER/PASS); fix nagging by Flexelint
- libnetclient/net-client-smtp.[ch]: report auth failure if the server replies with status codes 534 or 535; fix nagging by Flexelint
- libnetclient/net-client.[ch]: report a certificate key decryption error if the passphrase is wrong

_______________________________________________
balsa-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/balsa-list
clear_password_on_authfail.diff.bz2 (application/x-bzip, 2.6 KB) - not displayed
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEcCEPemLFTtyGf4zATKlvDmfn2fgFAlvrOS4ACgkQTKlvDmfn
2fiRJAf/ZmWcwuO8r0Z/FX8bgkWN1KLFhpuUDdenQr5Gi9UYznXfuo/6sAgj7Tx8
tdOnlhNtsYeNklVIwpTD6Mv5JXS++pkQeHalns63tozmVefaA6oFntJ1i45pwJLJ
ych5hSNyGAqtRJziJGTMrzjimLJ53GRS31w7QOgJ/nV6An20sfuulrCydh6+w+7h
ozQ1D6NxAyocL2QfhxLj0a/jzaNTvcDyahBXgOyZrUF5iU2N9EEIyIBZ/3Xr9pvp
CLxrcCPT0SEkTzjg6JL8uQ+PQKR1Y0vk6+Ger9VsgWXmNviJAyqHmOxWmYDAscn4
bFlefJmmLBinHvsO9XqVUCDsVCjrGg==
=Yibv
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.