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

BoringSSL support #21

Open
splitice opened this issue Jul 15, 2020 · 3 comments
Open

BoringSSL support #21

splitice opened this issue Jul 15, 2020 · 3 comments

Comments

@splitice
Copy link

EVP_EncryptFinal/EVP_DecryptFinal is not provided in BoringSSL. Perhaps EVP_EncryptFinal_ex.

Found in openresty/openresty#556

@urey-hiker
Copy link

I do patch like this on openresty-1.15.8, and it works fine with boringssl.

--- a/bundle/encrypted-session-nginx-module-0.08/src/ngx_http_encrypted_session_cipher.c
+++ b/bundle/encrypted-session-nginx-module-0.08/src/ngx_http_encrypted_session_cipher.c
@@ -105,8 +105,11 @@ ngx_http_encrypted_session_aes_mac_encrypt(

     p += len;

+#ifdef OPENSSL_IS_BORINGSSL
+    ret = EVP_EncryptFinal_ex(emcf->session_ctx, p, &len);
+#else
     ret = EVP_EncryptFinal(emcf->session_ctx, p, &len);
-
+#endif
     emcf->reset_cipher_ctx(emcf->session_ctx);

     if (!ret) {
@@ -198,9 +201,11 @@ ngx_http_encrypted_session_aes_mac_decrypt(
     }

     p += len;
-
+#ifdef OPENSSL_IS_BORINGSSL
+        ret = EVP_DecryptFinal_ex(emcf->session_ctx, p, &len);
+#else
     ret = EVP_DecryptFinal(emcf->session_ctx, p, &len);
-
+#endif

@Kullu14
Copy link

Kullu14 commented Mar 30, 2021

is BoringSSL support for nginx done ?

@splitice
Copy link
Author

For those interested I posted this: openresty/openresty#741

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

No branches or pull requests

3 participants