-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for a password callback & PKCS#12 files #195
Conversation
bd42abb
to
ceef0c3
Compare
b5c33a9
to
e9cccfd
Compare
Rest looks good to me, but I don't have much expertise in this area :) |
5e77506
to
a120643
Compare
e9cccfd
to
931e8bc
Compare
Please add new files to |
examples/complex.c
Outdated
@@ -80,6 +81,52 @@ static int certfail_handler(const xmpp_tlscert_t *cert, | |||
return read_char[0] == 'y' || read_char[0] == 'Y'; | |||
} | |||
|
|||
static int | |||
password_callback(char *pw, size_t pw_max, const char *fname, void *userdata) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick question before reading the function: is it expected to implement this number of steps by users every time? From the comment I understand, that this code caches password, but as far as I understand, for a single connection this callback will always be called for the same key file, right? If so, can we move caching to libstrophe? I know, this is not secure, but we already cache account's password. Besides, we can clear the cached password after connection establishment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I also thought about the same, but then the problem becomes: when the user enters a wrong password, how do we handle this? Simply bail out? Retry after wiping the cache? If we bail out we'd have to expose the TLS-stack specific error to the user ... or mangle it into an strophe-specific error ...
If we add caching, can it be disabled at run-time? compile-time?
caa90e3
to
a1bc90b
Compare
Moved them to #196 |
adba12f
to
b0d4b8c
Compare
a674463
to
e32d39d
Compare
b0d4b8c
to
2f620ae
Compare
d91982a
to
8a08baf
Compare
8a08baf
to
7f1d138
Compare
7f1d138
to
a34e2ac
Compare
a34e2ac
to
e5ff112
Compare
In order to be able to load password-protected key files a password callback was added. This also adds support for PKCS#12 containers instead of certificate+key. Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
15c0818
to
668df48
Compare
The cache is stored per connection object and is cleared on * entry of wrong password * release of connection object * successful connection It can be configured that libstrophe retries the password entry in case the user entered a wrong password. Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
`ERR_func_error_string()` has been deprecated. Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
56a0ef3
to
4f95174
Compare
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
4f95174
to
7111ee2
Compare
In order to be able to load password-protected key files a password
callback was added.
This also adds support for PKCS#12 containers instead of certificate+key.