From 0ba0572c4a8b1a0995384ab3dd1f3b75cdb60061 Mon Sep 17 00:00:00 2001 From: Pierre Chifflier Date: Wed, 19 Jan 2022 14:30:54 +0100 Subject: [PATCH] rust/x509: finish transition to nom7 --- rust/src/x509/mod.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rust/src/x509/mod.rs b/rust/src/x509/mod.rs index 25518387f9..03c9cc5aa0 100644 --- a/rust/src/x509/mod.rs +++ b/rust/src/x509/mod.rs @@ -18,6 +18,7 @@ // written by Pierre Chifflier use crate::common::rust_string_to_c; +use nom7::Err; use std; use std::os::raw::c_char; use x509_parser::prelude::*; @@ -131,10 +132,10 @@ pub unsafe extern "C" fn rs_x509_free(ptr: *mut X509) { drop(Box::from_raw(ptr)); } -fn x509_parse_error_to_errcode(e: &nom::Err) -> X509DecodeError { +fn x509_parse_error_to_errcode(e: &Err) -> X509DecodeError { match e { - nom::Err::Incomplete(_) => X509DecodeError::InvalidLength, - nom::Err::Error(e) | nom::Err::Failure(e) => match e { + Err::Incomplete(_) => X509DecodeError::InvalidLength, + Err::Error(e) | Err::Failure(e) => match e { X509Error::InvalidVersion => X509DecodeError::InvalidVersion, X509Error::InvalidSerial => X509DecodeError::InvalidSerial, X509Error::InvalidAlgorithmIdentifier => X509DecodeError::InvalidAlgorithmIdentifier,