Skip to content

Commit

Permalink
Improve documentation for passphrase callback (#703)
Browse files Browse the repository at this point in the history
Address issue #701
  • Loading branch information
aiguofer authored and reaperhulk committed Oct 12, 2017
1 parent 1eac0e8 commit fe0120f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions doc/api/ssl.rst
Expand Up @@ -369,8 +369,9 @@ Context objects have the following methods:
this, it will be truncated. Second, a boolean value which will be true if
the user should be prompted for the passphrase twice and the callback should
verify that the two values supplied are equal. Third, the value given as the
*userdata* parameter to :py:meth:`set_passwd_cb`. If an error occurs,
*callback* should return a false value (e.g. an empty string).
*userdata* parameter to :py:meth:`set_passwd_cb`. The *callback* must return
a byte string. If an error occurs, *callback* should return a false value
(e.g. an empty string).


.. py:method:: Context.set_session_cache_mode(mode)
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSSL/SSL.py
Expand Up @@ -695,7 +695,7 @@ def set_passwd_cb(self, callback, userdata=None):
"""
Set the passphrase callback
:param callback: The Python callback to use
:param callback: The Python callback to use; must return a byte string
:param userdata: (optional) A Python object which will be given as
argument to the callback
:return: None
Expand Down

0 comments on commit fe0120f

Please sign in to comment.