-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add explicit OpenSSL version checks to attestation-ca and webauthn-rs…
…-core
- Loading branch information
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use openssl::version::{number, version}; | ||
|
||
const OPENSSL_DOC: &str = "https://github.com/kanidm/webauthn-rs/blob/master/OpenSSL.md"; | ||
|
||
fn main() { | ||
// LibreSSL reports as OpenSSL v2 (which was skipped). | ||
if number() < 0x2_00_00_00_0 { | ||
println!( | ||
r#" | ||
Your version of OpenSSL is out of date, and not supported by this library. | ||
Please upgrade to OpenSSL v3.0.0 or later. | ||
More info: {OPENSSL_DOC} | ||
OpenSSL version string: {} | ||
"#, | ||
version(), | ||
); | ||
panic!("The installed version of OpenSSL is unusable."); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use openssl::version::{number, version}; | ||
|
||
const OPENSSL_DOC: &str = "https://github.com/kanidm/webauthn-rs/blob/master/OpenSSL.md"; | ||
|
||
fn main() { | ||
// LibreSSL reports as OpenSSL v2. | ||
if number() < 0x2_00_00_00_0 { | ||
println!( | ||
r#" | ||
Your version of OpenSSL is out of date, and not supported by this library. | ||
Please upgrade to OpenSSL v3.0.0 or later. | ||
More info: {OPENSSL_DOC} | ||
OpenSSL version string: {} | ||
"#, | ||
version(), | ||
); | ||
panic!("The installed version of OpenSSL is unusable."); | ||
} | ||
} |