monkeyDluffy6017 commented on code in PR #10771:
URL: https://github.com/apache/apisix/pull/10771#discussion_r1452900395


##########
apisix/ssl.lua:
##########
@@ -125,21 +114,18 @@ end
 
 function _M.aes_encrypt_pkey(origin, field)
     local local_conf = core.config.local_conf()
+    local aes_128_cbc_with_iv_tbl_gde = get_aes_128_cbc_with_iv_gde(local_conf)
+    local aes_128_cbc_with_iv_gde = aes_128_cbc_with_iv_tbl_gde[1]
 
-    if not field then
-        -- default used by ssl
-        local aes_128_cbc_with_iv_tbl_ssl = 
get_aes_128_cbc_with_iv_ssl(local_conf)
-        local aes_128_cbc_with_iv_ssl = aes_128_cbc_with_iv_tbl_ssl[1]
-        if aes_128_cbc_with_iv_ssl ~= nil and core.string.has_prefix(origin, 
"---") then
-            return encrypt(aes_128_cbc_with_iv_ssl, origin)
-        end
+    if aes_128_cbc_with_iv_gde == nil then
+        return origin
+    end
+
+    if not field and core.string.has_prefix(origin, "---") then

Review Comment:
   I prefer the later one: `reserve the check and put it to ssl and data 
encryption`, the `data encryption` don't have a prefix like `---`, so no need 
to consider the `data encryption`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to