Finish eliminating consts module

Either moves constants into their relevant modules, or puts the
remaining ones into `lib.rs`
This commit is contained in:
Tony Arcieri
2019-12-08 09:32:57 -08:00
parent 86b8c6a6db
commit 31efd4e78c
11 changed files with 86 additions and 47 deletions
+10 -2
View File
@@ -31,13 +31,12 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
use crate::{
consts::*,
error::Error,
key::{AlgorithmId, SlotId},
serialization::*,
transaction::Transaction,
yubikey::YubiKey,
Buffer,
Buffer, CB_OBJ_TAG_MIN,
};
use elliptic_curve::weierstrass::{
curve::{NistP256, NistP384},
@@ -49,6 +48,9 @@ use std::fmt;
use x509_parser::{parse_x509_der, x509::SubjectPublicKeyInfo};
use zeroize::Zeroizing;
#[cfg(feature = "untested")]
use crate::CB_OBJ_MAX;
// TODO: Make these der_parser::oid::Oid constants when it has const fn support.
const OID_RSA_ENCRYPTION: &str = "1.2.840.113549.1.1.1";
const OID_EC_PUBLIC_KEY: &str = "1.2.840.10045.2.1";
@@ -60,6 +62,12 @@ const CERTINFO_UNCOMPRESSED: u8 = 0;
#[cfg(feature = "untested")]
const CERTINFO_GZIP: u8 = 1;
const TAG_CERT: u8 = 0x70;
#[cfg(feature = "untested")]
const TAG_CERT_COMPRESS: u8 = 0x71;
#[cfg(feature = "untested")]
const TAG_CERT_LRC: u8 = 0xFE;
/// Information about a public key within a [`Certificate`].
#[derive(Clone, Eq, PartialEq)]
pub enum PublicKeyInfo {