Skip to content

Commit

Permalink
Fix race condition with X509Name creation
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Mar 24, 2023
1 parent a752805 commit 6ced4f3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion openssl/src/x509/mod.rs
Expand Up @@ -1045,7 +1045,10 @@ impl X509NameBuilder {

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

Expand Down

0 comments on commit 6ced4f3

Please sign in to comment.