Skip to content

Add support for a wolfSSL crypto backend. - #629

Merged
willco007 merged 1 commit into
libssh2:masterfrom
haydenroche5:wolfssl
Jan 6, 2022
Merged

willco007 merged 1 commit into
libssh2:masterfrom
haydenroche5:wolfssl

Conversation

@haydenroche5

Copy link
Copy Markdown
Contributor

It uses wolfSSL's OpenSSL compatibility layer, so rather than introduce new
wolfssl.h/c files, the new backend just reuses openssl.h/c. Additionally,
replace EVP_Cipher() calls with EVP_CipherUpdate(), since EVP_Cipher() is not
recommended.

Comment thread src/openssl.c

#ifdef HAVE_OPAQUE_STRUCTS
ret = EVP_Cipher(*ctx, buf, block, blocksize);
ret = EVP_CipherUpdate(*ctx, buf, &outlen, block, blocksize);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think simply switching to using EVP_CipherUpdate here clears up the return code complexity.

It uses wolfSSL's OpenSSL compatibility layer, so rather than introduce new
wolfssl.h/c files, the new backend just reuses openssl.h/c. Additionally,
replace EVP_Cipher() calls with EVP_CipherUpdate(), since EVP_Cipher() is not
recommended.
@willco007

Copy link
Copy Markdown
Member

This is great! I would like to see this backend added to the ci if possible, is that something you might be able to tackle?

@haydenroche5

Copy link
Copy Markdown
Contributor Author

This is great! I would like to see this backend added to the ci if possible, is that something you might be able to tackle?

Sure, I can look into that. Got any examples/docs that I can use to get set up with your CI system?

@willco007

Copy link
Copy Markdown
Member

The file that needs updating is .github/workflows/ci.yml. Basically you'd need to add wolf to the matrix and then install it; you can model the code off the mbedtls backend which does something similar.

@willco007

Copy link
Copy Markdown
Member

I'm going to land this to make sure it gets into the next release. I'd still like to see it in CI when you have some time @haydenroche5. Thanks again!

@willco007
willco007 merged commit 17c9c1f into libssh2:master Jan 6, 2022
willco007 pushed a commit to willco007/libssh2 that referenced this pull request Jan 13, 2022
It uses wolfSSL's OpenSSL compatibility layer, so rather than introduce new
wolfssl.h/c files, the new backend just reuses openssl.h/c. Additionally,
replace EVP_Cipher() calls with EVP_CipherUpdate(), since EVP_Cipher() is not
recommended.

Credit: Hayden Roche
jakob added a commit to jakob/libssh2 that referenced this pull request Oct 28, 2022
This reverts commit 17c9c1f.

# Conflicts:
#	src/openssl.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants