Skip to content

Commit e21587a

Browse files
committed
added use of Strings.toLowerCase()
1 parent f36c59f commit e21587a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

prov/src/main/java/org/bouncycastle/jce/provider/X509LDAPCertStoreSpi.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import org.bouncycastle.asn1.ASN1InputStream;
3535
import org.bouncycastle.asn1.x509.CertificatePair;
3636
import org.bouncycastle.jce.X509LDAPCertStoreParameters;
37+
import org.bouncycastle.util.Strings;
3738

3839
/**
3940
* This is a general purpose implementation to get X.509 certificates and CRLs
@@ -126,8 +127,7 @@ private DirContext connectLDAP()
126127
private String parseDN(String subject, String subjectAttributeName)
127128
{
128129
String temp = subject;
129-
int begin = temp.toLowerCase().indexOf(
130-
subjectAttributeName.toLowerCase());
130+
int begin = Strings.toLowerCase(temp).indexOf(Strings.toLowerCase(subjectAttributeName));
131131
temp = temp.substring(begin + subjectAttributeName.length());
132132
int end = temp.indexOf(',');
133133
if (end == -1)

prov/src/main/java/org/bouncycastle/x509/util/LDAPStoreHelper.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import org.bouncycastle.jce.provider.X509CertPairParser;
3737
import org.bouncycastle.jce.provider.X509CertParser;
3838
import org.bouncycastle.util.StoreException;
39+
import org.bouncycastle.util.Strings;
3940
import org.bouncycastle.x509.X509AttributeCertStoreSelector;
4041
import org.bouncycastle.x509.X509AttributeCertificate;
4142
import org.bouncycastle.x509.X509CRLStoreSelector;
@@ -113,8 +114,8 @@ private DirContext connectLDAP() throws NamingException
113114
private String parseDN(String subject, String dNAttributeName)
114115
{
115116
String temp = subject;
116-
int begin = temp.toLowerCase().indexOf(
117-
dNAttributeName.toLowerCase() + "=");
117+
int begin = Strings.toLowerCase(temp).indexOf(
118+
Strings.toLowerCase(dNAttributeName) + "=");
118119
if (begin == -1)
119120
{
120121
return "";

0 commit comments

Comments
 (0)