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:46:20 UTC

[commons-crypto] branch master updated: In-line local single-use local var

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


The following commit(s) were added to refs/heads/master by this push:
     new f2d7604  In-line local single-use local var
f2d7604 is described below

commit f2d7604728f2e7a35565238079ad9bfe29e2e480
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Dec 12 17:46:16 2022 -0500

    In-line local single-use local var
---
 src/main/java/org/apache/commons/crypto/jna/OpenSslJnaCipher.java   | 6 ++----
 .../java/org/apache/commons/crypto/jna/OpenSslJnaCryptoRandom.java  | 3 +--
 2 files changed, 3 insertions(+), 6 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 bcb81b1..a01b7e0 100644
--- a/src/main/java/org/apache/commons/crypto/jna/OpenSslJnaCipher.java
+++ b/src/main/java/org/apache/commons/crypto/jna/OpenSslJnaCipher.java
@@ -156,8 +156,7 @@ final class OpenSslJnaCipher implements CryptoCipher {
     @Override
     public int update(final ByteBuffer inBuffer, final ByteBuffer outBuffer) throws ShortBufferException {
         final int[] outlen = new int[1];
-        final int retVal = OpenSslNativeJna.EVP_CipherUpdate(context, outBuffer, outlen, inBuffer, inBuffer.remaining());
-        throwOnError(retVal);
+        throwOnError(OpenSslNativeJna.EVP_CipherUpdate(context, outBuffer, outlen, inBuffer, inBuffer.remaining()));
         final int len = outlen[0];
         inBuffer.position(inBuffer.limit());
         outBuffer.position(outBuffer.position() + len);
@@ -212,8 +211,7 @@ final class OpenSslJnaCipher implements CryptoCipher {
             throws ShortBufferException, IllegalBlockSizeException, BadPaddingException {
         final int uptLen = update(inBuffer, outBuffer);
         final int[] outlen = new int[1];
-        final int retVal = OpenSslNativeJna.EVP_CipherFinal_ex(context, outBuffer, outlen);
-        throwOnError(retVal);
+        throwOnError(OpenSslNativeJna.EVP_CipherFinal_ex(context, outBuffer, outlen));
         final int len = uptLen + outlen[0];
         outBuffer.position(outBuffer.position() + outlen[0]);
         return len;
diff --git a/src/main/java/org/apache/commons/crypto/jna/OpenSslJnaCryptoRandom.java b/src/main/java/org/apache/commons/crypto/jna/OpenSslJnaCryptoRandom.java
index ba38dd7..f587c00 100644
--- a/src/main/java/org/apache/commons/crypto/jna/OpenSslJnaCryptoRandom.java
+++ b/src/main/java/org/apache/commons/crypto/jna/OpenSslJnaCryptoRandom.java
@@ -107,8 +107,7 @@ final class OpenSslJnaCryptoRandom implements CryptoRandom {
 
             final int byteLength = bytes.length;
             final ByteBuffer buf = ByteBuffer.allocateDirect(byteLength);
-            final int retVal = OpenSslNativeJna.RAND_bytes(buf, byteLength);
-            throwOnError(retVal);
+            throwOnError(OpenSslNativeJna.RAND_bytes(buf, byteLength));
             buf.rewind();
             buf.get(bytes, 0, byteLength);
         }