|
|
|
@ -52,6 +52,7 @@ import java.security.GeneralSecurityException;
|
|
|
|
|
import java.security.spec.AlgorithmParameterSpec; |
|
|
|
|
import java.security.spec.KeySpec; |
|
|
|
|
import java.text.MessageFormat; |
|
|
|
|
import java.util.Locale; |
|
|
|
|
import java.util.Properties; |
|
|
|
|
import java.util.regex.Matcher; |
|
|
|
|
import java.util.regex.Pattern; |
|
|
|
@ -192,7 +193,7 @@ abstract class WalkEncryption {
|
|
|
|
|
|
|
|
|
|
// Standard names are not case-sensitive.
|
|
|
|
|
// http://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html
|
|
|
|
|
String cryptoName = cryptoAlg.toUpperCase(); |
|
|
|
|
String cryptoName = cryptoAlg.toUpperCase(Locale.ROOT); |
|
|
|
|
|
|
|
|
|
if (!cryptoName.startsWith("PBE")) //$NON-NLS-1$
|
|
|
|
|
throw new GeneralSecurityException(JGitText.get().encryptionOnlyPBE); |
|
|
|
@ -373,7 +374,7 @@ abstract class WalkEncryption {
|
|
|
|
|
|
|
|
|
|
SecretKey keyBase = factory.generateSecret(keySpec); |
|
|
|
|
|
|
|
|
|
String name = cipherAlgo.toUpperCase(); |
|
|
|
|
String name = cipherAlgo.toUpperCase(Locale.ROOT); |
|
|
|
|
Matcher matcherPBE = Pattern.compile(REGEX_PBE).matcher(name); |
|
|
|
|
Matcher matcherTrans = Pattern.compile(REGEX_TRANS).matcher(name); |
|
|
|
|
if (matcherPBE.matches()) { |
|
|
|
@ -506,7 +507,7 @@ abstract class WalkEncryption {
|
|
|
|
|
JGitV1(String algo, String pass) |
|
|
|
|
throws GeneralSecurityException { |
|
|
|
|
super(wrap(algo, pass)); |
|
|
|
|
String name = cipherAlgo.toUpperCase(); |
|
|
|
|
String name = cipherAlgo.toUpperCase(Locale.ROOT); |
|
|
|
|
Matcher matcherPBE = Pattern.compile(REGEX_PBE).matcher(name); |
|
|
|
|
if (!matcherPBE.matches()) |
|
|
|
|
throw new GeneralSecurityException( |
|
|
|
|