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/mina-sshd.git


The following commit(s) were added to refs/heads/master by this push:
     new 2441711fd Use a StringBuilder
2441711fd is described below

commit 2441711fdd497b49c20811852d12c42262288c20
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Thu May 30 09:53:07 2024 -0400

    Use a StringBuilder
    
    Synchronization is not needed for these temporary local buffers
---
 .../apache/sshd/common/config/keys/loader/openssh/kdf/BCrypt.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/sshd-common/src/main/java/org/apache/sshd/common/config/keys/loader/openssh/kdf/BCrypt.java
 
b/sshd-common/src/main/java/org/apache/sshd/common/config/keys/loader/openssh/kdf/BCrypt.java
index 0a78aa8c8..d84dd0e1e 100644
--- 
a/sshd-common/src/main/java/org/apache/sshd/common/config/keys/loader/openssh/kdf/BCrypt.java
+++ 
b/sshd-common/src/main/java/org/apache/sshd/common/config/keys/loader/openssh/kdf/BCrypt.java
@@ -403,7 +403,7 @@ public class BCrypt {
   private static String encode_base64(byte d[], int len)
       throws IllegalArgumentException {
       int off = 0;
-      StringBuffer rs = new StringBuffer();
+      StringBuilder rs = new StringBuilder();
       int c1, c2;
 
       if (len <= 0 || len > d.length)
@@ -456,7 +456,7 @@ public class BCrypt {
    */
   private static byte[] decode_base64(String s, int maxolen)
       throws IllegalArgumentException {
-      StringBuffer rs = new StringBuffer();
+      StringBuilder rs = new StringBuilder();
       int off = 0, slen = s.length(), olen = 0;
       byte ret[];
       byte c1, c2, c3, c4, o;
@@ -758,7 +758,7 @@ public class BCrypt {
       byte passwordb[], saltb[], hashed[];
       char minor = (char)0;
       int rounds, off = 0;
-      StringBuffer rs = new StringBuffer();
+      StringBuilder rs = new StringBuilder();
 
       if (salt.charAt(0) != '$' || salt.charAt(1) != '2')
           throw new IllegalArgumentException ("Invalid salt version");
@@ -815,7 +815,7 @@ public class BCrypt {
    * @return  an encoded salt value
    */
   public static String gensalt(int log_rounds, SecureRandom random) {
-      StringBuffer rs = new StringBuffer();
+      StringBuilder rs = new StringBuilder();
       byte rnd[] = new byte[BCRYPT_SALT_LEN];
 
       random.nextBytes(rnd);

Reply via email to