You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/12/12 22:43:18 UTC

[commons-crypto] branch master updated (6186036 -> 5eb5b72)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-crypto.git


    from 6186036  Make package-private classes final
     new e163e48  In-line local single-use local var
     new 5eb5b72  Validate return value from OpenSslNativeJna.EVP_CIPHER_CTX_set_padding().

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/changes/changes.xml                                           | 1 +
 src/main/java/org/apache/commons/crypto/jna/OpenSslJnaCipher.java | 5 ++---
 2 files changed, 3 insertions(+), 3 deletions(-)


[commons-crypto] 01/02: In-line local single-use local var

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-crypto.git

commit e163e483f54646ea37b5a1447783711b9ede72b1
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Dec 12 17:37:01 2022 -0500

    In-line local single-use local var
---
 src/main/java/org/apache/commons/crypto/jna/OpenSslJnaCipher.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/commons/crypto/jna/OpenSslJnaCipher.java b/src/main/java/org/apache/commons/crypto/jna/OpenSslJnaCipher.java
index 5c5fd64..f4e914d 100644
--- a/src/main/java/org/apache/commons/crypto/jna/OpenSslJnaCipher.java
+++ b/src/main/java/org/apache/commons/crypto/jna/OpenSslJnaCipher.java
@@ -139,8 +139,7 @@ final class OpenSslJnaCipher implements CryptoCipher {
             }
         }
 
-        final int retVal = OpenSslNativeJna.EVP_CipherInit_ex(context, algo, null, key.getEncoded(), iv, cipherMode);
-        throwOnError(retVal);
+        throwOnError(OpenSslNativeJna.EVP_CipherInit_ex(context, algo, null, key.getEncoded(), iv, cipherMode));
         OpenSslNativeJna.EVP_CIPHER_CTX_set_padding(context, padding);
     }
 


[commons-crypto] 02/02: Validate return value from OpenSslNativeJna.EVP_CIPHER_CTX_set_padding().

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-crypto.git

commit 5eb5b728362f1b376466f10c062fcd2e56358c51
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Dec 12 17:43:14 2022 -0500

    Validate return value from
    OpenSslNativeJna.EVP_CIPHER_CTX_set_padding().
---
 src/changes/changes.xml                                           | 1 +
 src/main/java/org/apache/commons/crypto/jna/OpenSslJnaCipher.java | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index fb108fd..360988a 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -74,6 +74,7 @@
       <action issue="CRYPTO-155" type="fix" due-to="Arturo Bernal">Minor improvement #115, #125.</action>
       <action                    type="fix" dev="ggregory" due-to="Gary Gregory">PositionedCryptoInputStream does not close its CryptoCipher instances.</action>
       <action issue="CRYPTO-160" type="fix" dev="ggregory" due-to="Gary Gregory">Package-private class JavaCryptoRandom extends Random but should not.</action>
+      <action                    type="fix" dev="ggregory" due-to="Gary Gregory">Validate return value from OpenSslNativeJna.EVP_CIPHER_CTX_set_padding().</action>
       <!-- ADD -->
       <action                    type="fix" dev="ggregory" due-to="Gary Gregory, Dependabot">Add github/codeql-action 2 #159.</action>
       <action                    type="fix" dev="ggregory" due-to="Gary Gregory, Dependabot">Add AES utility class.</action>
diff --git a/src/main/java/org/apache/commons/crypto/jna/OpenSslJnaCipher.java b/src/main/java/org/apache/commons/crypto/jna/OpenSslJnaCipher.java
index f4e914d..bcb81b1 100644
--- a/src/main/java/org/apache/commons/crypto/jna/OpenSslJnaCipher.java
+++ b/src/main/java/org/apache/commons/crypto/jna/OpenSslJnaCipher.java
@@ -140,7 +140,7 @@ final class OpenSslJnaCipher implements CryptoCipher {
         }
 
         throwOnError(OpenSslNativeJna.EVP_CipherInit_ex(context, algo, null, key.getEncoded(), iv, cipherMode));
-        OpenSslNativeJna.EVP_CIPHER_CTX_set_padding(context, padding);
+        throwOnError(OpenSslNativeJna.EVP_CIPHER_CTX_set_padding(context, padding));
     }
 
     /**