Move certificate parsing into Metadata::extract

This commit is contained in:
Jack Grigg
2022-12-31 18:47:39 +00:00
parent c8f9df1b45
commit d8eb198e97
4 changed files with 11 additions and 17 deletions
+1 -2
View File
@@ -542,9 +542,8 @@ impl Connection {
) -> io::Result<Result<(), identity::Error>> {
// Check if we can skip requesting a PIN.
if self.cached_metadata.is_none() {
let (_, cert) = x509_parser::parse_x509_certificate(self.cert.as_ref()).unwrap();
self.cached_metadata =
match Metadata::extract(&mut self.yubikey, self.slot, &cert, true) {
match Metadata::extract(&mut self.yubikey, self.slot, &self.cert, true) {
None => {
return Ok(Err(identity::Error::Identity {
index: self.identity_index,