Skip to content

Commit 6ced4f3

Browse files
committed
Fix race condition with X509Name creation
1 parent a752805 commit 6ced4f3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

openssl/src/x509/mod.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,10 @@ impl X509NameBuilder {
10451045

10461046
/// Return an `X509Name`.
10471047
pub fn build(self) -> X509Name {
1048-
self.0
1048+
// Round-trip through bytes because OpenSSL is not const correct and
1049+
// names in a "modified" state compute various things lazily. This can
1050+
// lead to data-races because OpenSSL doesn't have locks or anything.
1051+
X509Name::from_der(&self.0.to_der().unwrap()).unwrap()
10491052
}
10501053
}
10511054

0 commit comments

Comments
 (0)