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/18 22:04:58 UTC

[commons-crypto] branch master updated: Convert local variable to constant

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 f80da78  Convert local variable to constant
f80da78 is described below

commit f80da78cdef84b507df60d5afb1d24c5b8d02c1e
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Dec 18 17:04:55 2022 -0500

    Convert local variable to constant
---
 .../java/org/apache/commons/crypto/jna/OpenSslJnaCryptoRandom.java     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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 babb712..f1ed19e 100644
--- a/src/main/java/org/apache/commons/crypto/jna/OpenSslJnaCryptoRandom.java
+++ b/src/main/java/org/apache/commons/crypto/jna/OpenSslJnaCryptoRandom.java
@@ -46,6 +46,8 @@ import com.sun.jna.ptr.PointerByReference;
  */
 final class OpenSslJnaCryptoRandom implements CryptoRandom {
 
+    private static final int ENGINE_METHOD_RAND = 0x0008;
+
     private final boolean rdrandEnabled;
     private final transient PointerByReference rdrandEngine;
 
@@ -65,7 +67,6 @@ final class OpenSslJnaCryptoRandom implements CryptoRandom {
         try {
             OpenSslNativeJna.ENGINE_load_rdrand();
             rdrandEngine = OpenSslNativeJna.ENGINE_by_id("rdrand");
-            final int ENGINE_METHOD_RAND = 0x0008;
             if (rdrandEngine != null) {
                 final int rc = OpenSslNativeJna.ENGINE_init(rdrandEngine);