consts: Whittle down to the essentials
This factors the junk drawer of constants into the relevant files. There are still a few "global" ones left but they can be addressed in a followup commit.
This commit is contained in:
+6
-1
@@ -55,6 +55,11 @@ const OID_EC_PUBLIC_KEY: &str = "1.2.840.10045.2.1";
|
||||
const OID_NIST_P256: &str = "1.2.840.10045.3.1.7";
|
||||
const OID_NIST_P384: &str = "1.3.132.0.34";
|
||||
|
||||
#[allow(dead_code)]
|
||||
const CERTINFO_UNCOMPRESSED: u8 = 0;
|
||||
#[cfg(feature = "untested")]
|
||||
const CERTINFO_GZIP: u8 = 1;
|
||||
|
||||
/// Information about a public key within a [`Certificate`].
|
||||
#[derive(Clone, Eq, PartialEq)]
|
||||
pub enum PublicKeyInfo {
|
||||
@@ -273,7 +278,7 @@ pub(crate) fn write_certificate(
|
||||
// write compression info and LRC trailer
|
||||
buf[offset] = TAG_CERT_COMPRESS;
|
||||
buf[offset + 1] = 0x01;
|
||||
buf[offset + 2] = if certinfo == YKPIV_CERTINFO_GZIP {
|
||||
buf[offset + 2] = if certinfo == CERTINFO_GZIP {
|
||||
0x01
|
||||
} else {
|
||||
0x00
|
||||
|
||||
Reference in New Issue
Block a user