Skip to content
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 example of using password callback #21

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add example of using password callback
JacobBarthelmeh committed Jul 14, 2021
commit 1aee33f3f15d2e7d8c8e8e82ffb3baa119ce5d51
9 changes: 9 additions & 0 deletions examples/client.py
Original file line number Diff line number Diff line change
@@ -100,6 +100,14 @@ def get_method(index):
)[index]


# Callback for wolfssl/certs/client-keyEnc.pem (yassl123 password)
# sz is the max size of password allowed
# rw is type i.e PEM_PASS_READ
# userdata is a void pointer potentially set by user
def password_cb(sz, rw, userdata):
return "yassl123"


def main():
args = build_arg_parser().parse_args()

@@ -110,6 +118,7 @@ def main():

context = wolfssl.SSLContext(get_method(args.v))

context.set_passwd_cb(password_cb)
context.load_cert_chain(args.c, args.k)

if args.d: