Infer fixes for WolfSSLCertificate

pull/182/head
Chris Conlon 2024-04-03 10:49:01 -06:00
parent 5d5733f19e
commit d8a422e272
1 changed files with 15 additions and 13 deletions

View File

@ -323,8 +323,10 @@ public class WolfSSLCertificate {
confirmObjectIsActive(); confirmObjectIsActive();
synchronized (x509Lock) {
return this.x509Ptr; return this.x509Ptr;
} }
}
/** /**
* Set the Subject Name to be used with this WolfSSLCertificate. * Set the Subject Name to be used with this WolfSSLCertificate.
@ -1435,6 +1437,7 @@ public class WolfSSLCertificate {
confirmObjectIsActive(); confirmObjectIsActive();
synchronized (x509Lock) {
if (this.altNames != null) { if (this.altNames != null) {
/* already gathered, return cached version */ /* already gathered, return cached version */
return this.altNames; return this.altNames;
@ -1442,7 +1445,6 @@ public class WolfSSLCertificate {
Collection<List<?>> names = new ArrayList<List<?>>(); Collection<List<?>> names = new ArrayList<List<?>>();
synchronized (x509Lock) {
String nextAltName = X509_get_next_altname(this.x509Ptr); String nextAltName = X509_get_next_altname(this.x509Ptr);
while (nextAltName != null) { while (nextAltName != null) {
Object[] entry = new Object[2]; Object[] entry = new Object[2];
@ -1453,13 +1455,13 @@ public class WolfSSLCertificate {
names.add(Collections.unmodifiableList(entryList)); names.add(Collections.unmodifiableList(entryList));
nextAltName = X509_get_next_altname(this.x509Ptr); nextAltName = X509_get_next_altname(this.x509Ptr);
} }
}
/* cache altNames collection for later use */ /* cache altNames collection for later use */
this.altNames = Collections.unmodifiableCollection(names); this.altNames = Collections.unmodifiableCollection(names);
return this.altNames; return this.altNames;
} }
}
/** /**
* Returns X509Certificate object based on this certificate. * Returns X509Certificate object based on this certificate.