Changeset 34634 in osm for applications/editors/josm/plugins/native-password-manager/src
- Timestamp:
- 2018-09-11T19:19:45+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/native-password-manager/src/org
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/fallback/FallbackProvider.java
r33579 r34634 43 43 package org.netbeans.modules.keyring.fallback; 44 44 45 import java.nio.charset.StandardCharsets; 45 46 import java.security.SecureRandom; 46 47 import java.util.logging.Level; … … 90 91 byte[] randomArray = new byte[36]; 91 92 new SecureRandom().nextBytes(randomArray); 92 if (_save(SAMPLE_KEY, (SAMPLE_KEY + new String(randomArray)).toCharArray(), 93 if (_save(SAMPLE_KEY, (SAMPLE_KEY + new String(randomArray, StandardCharsets.UTF_8)).toCharArray(), 93 94 "Sample value ensuring that decryption is working.")) { 94 95 LOG.fine("saved sample key"); -
applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/kde/KWalletProvider.java
r33587 r34634 46 46 import java.io.IOException; 47 47 import java.io.InputStreamReader; 48 import java.nio.charset.StandardCharsets; 48 49 import java.util.Arrays; 49 50 import java.util.logging.Level; … … 96 97 CommandResult result = runCommand("writePassword", handler , getApplicationName() 97 98 , key.toCharArray(), password , getApplicationName()); 98 if (result.exitCode != 0 || (new String(result.retVal)).equals("-1")){99 if (result.exitCode != 0 || new String(result.retVal).equals("-1")) { 99 100 warning("save action failed"); 100 101 } … … 109 110 CommandResult result = runCommand("removeEntry" ,handler, 110 111 getApplicationName() , key.toCharArray() , getApplicationName()); 111 if (result.exitCode != 0 || (new String(result.retVal)).equals("-1")){112 if (result.exitCode != 0 || new String(result.retVal).equals("-1")) { 112 113 warning("delete action failed"); 113 114 } … … 176 177 Process pr = rt.exec(argv); 177 178 178 try (BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream()))) { 179 try (BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream(), StandardCharsets.UTF_8))) { 179 180 180 181 String line; … … 186 187 } 187 188 } 188 try (BufferedReader input = new BufferedReader(new InputStreamReader(pr.getErrorStream()))) { 189 try (BufferedReader input = new BufferedReader(new InputStreamReader(pr.getErrorStream(), StandardCharsets.UTF_8))) { 189 190 190 191 String line; -
applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/DatatypeConverter.java
r34447 r34634 117 117 } 118 118 if (quadruplet[3] != PADDING) { 119 out[o++] = (byte) ((quadruplet[2] << 6) | (quadruplet[3]));119 out[o++] = (byte) ((quadruplet[2] << 6) | quadruplet[3]); 120 120 } 121 121 q = 0; … … 195 195 if (remaining == 1) { 196 196 buf[ptr++] = encode(input[i] >> 2); 197 buf[ptr++] = encode(( (input[i])& 0x3) << 4);197 buf[ptr++] = encode((input[i] & 0x3) << 4); 198 198 buf[ptr++] = '='; 199 199 buf[ptr++] = '='; -
applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/NPMCredentialsAgent.java
r34472 r34634 7 7 import java.net.Authenticator.RequestorType; 8 8 import java.net.PasswordAuthentication; 9 import java.nio.charset.StandardCharsets; 9 10 import java.util.ArrayList; 10 11 import java.util.HashMap; … … 63 64 64 65 CRC32 id = new CRC32(); 65 id.update((pref+"/"+url).getBytes()); 66 id.update((pref+"/"+url).getBytes(StandardCharsets.UTF_8)); 66 67 67 68 String hash = Integer.toHexString((int)id.getValue()); … … 76 77 77 78 CRC32 id = new CRC32(); 78 id.update((pref+"/"+host+"/"+port).getBytes()); 79 id.update((pref+"/"+host+"/"+port).getBytes(StandardCharsets.UTF_8)); 79 80 80 81 String hash = Integer.toHexString((int)id.getValue()); … … 88 89 89 90 CRC32 id = new CRC32(); 90 id.update( (pref).getBytes());91 id.update(pref.getBytes(StandardCharsets.UTF_8)); 91 92 92 93 String hash = Integer.toHexString((int)id.getValue());
Note:
See TracChangeset
for help on using the changeset viewer.