diff options
author | Sam Saccone <samccone@google.com> | 2023-12-19 03:19:36 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-12-19 03:19:36 +0000 |
commit | bf2a77b631d02948bafbf1424c1009d8fcb83f4f (patch) | |
tree | 2afec7623caafa2fd114b7ff7ee126a04d6376a1 | |
parent | 2980108add51315f748899573ff781ba2042c053 (diff) | |
parent | 75de5eaf32d60a8ab02dd37080526fe67d6b2cab (diff) | |
download | const-oid-bf2a77b631d02948bafbf1424c1009d8fcb83f4f.tar.gz |
Revert "Upgrade const-oid to 0.9.6" am: 2fce4bf4c1 am: 73c7a08f04 am: 75de5eaf32
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/const-oid/+/2880485
Change-Id: I8297fe12af8451a7daf97b5f2f3631a99e75e820
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | Android.bp | 4 | ||||
-rw-r--r-- | CHANGELOG.md | 30 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | Cargo.toml.orig | 2 | ||||
-rw-r--r-- | METADATA | 21 | ||||
-rw-r--r-- | src/db.rs | 38 | ||||
-rw-r--r-- | src/db/gen.rs | 60 |
8 files changed, 17 insertions, 142 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index a460abc..9b0b48f 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,6 +1,6 @@ { "git": { - "sha1": "4432bcc0b2b721865740517e609e166e01726ccc" + "sha1": "6489ca88e5d26fd2f754679ed5d511b817eb20d1" }, "path_in_vcs": "const-oid" }
\ No newline at end of file @@ -35,7 +35,7 @@ rust_library_host { name: "libconst_oid", crate_name: "const_oid", cargo_env_compat: true, - cargo_pkg_version: "0.9.6", + cargo_pkg_version: "0.9.2", srcs: ["src/lib.rs"], edition: "2021", features: ["db"], @@ -45,7 +45,7 @@ rust_library_rlib { name: "libconst_oid_nostd", crate_name: "const_oid", cargo_env_compat: true, - cargo_pkg_version: "0.9.6", + cargo_pkg_version: "0.9.2", srcs: ["src/lib.rs"], edition: "2021", features: ["db"], diff --git a/CHANGELOG.md b/CHANGELOG.md index f47c0c4..f6ea7d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,36 +4,6 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## 0.9.6 (2023-12-14) -### Added -- RFC 6962 OID ([#1282]) - -[#1282]: https://github.com/RustCrypto/formats/pull/1282 - -## 0.9.5 (2023-08-02) -### Added -- rfc8410 (curve25519) OIDS. ([#867]) - -[#867]: https://github.com/RustCrypto/formats/pull/867 - -## 0.9.4 (2023-07-10) -### Added -- rfc8894 (SCEP) OIDs. ([#1114]) - -[#1114]: https://github.com/RustCrypto/formats/pull/1114 - -## 0.9.3 (2023-06-29) -### Added -- `Database::find_names_for_oid` ([#1129]) - -[#1129]: https://github.com/RustCrypto/formats/pull/1129 - -## 0.9.2 (2023-02-26) -### Added -- Implement `Arbitrary` trait ([#761]) - -[#761]: https://github.com/RustCrypto/formats/pull/761 - ## 0.9.1 (2022-11-12) ### Added - clippy lints for checked arithmetic and panics ([#561]) @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.57" name = "const-oid" -version = "0.9.6" +version = "0.9.2" authors = ["RustCrypto Developers"] description = """ Const-friendly implementation of the ISO/IEC Object Identifier (OID) standard diff --git a/Cargo.toml.orig b/Cargo.toml.orig index 368373d..93f81dd 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "const-oid" -version = "0.9.6" +version = "0.9.2" authors = ["RustCrypto Developers"] license = "Apache-2.0 OR MIT" description = """ @@ -1,20 +1,23 @@ # This project was upgraded with external_updater. # Usage: tools/external_updater/updater.sh update rust/crates/const-oid -# For more info, check https://cs.android.com/android/platform/superproject/+/main:tools/external_updater/README.md +# For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md name: "const-oid" description: "Const-friendly implementation of the ISO/IEC Object Identifier (OID) standard as defined in ITU X.660, with support for BER/DER encoding/decoding as well as heapless no_std (i.e. embedded) support" third_party { + url { + type: HOMEPAGE + value: "https://crates.io/crates/const-oid" + } + url { + type: ARCHIVE + value: "https://static.crates.io/crates/const-oid/const-oid-0.9.2.crate" + } + version: "0.9.2" license_type: NOTICE last_upgrade_date { year: 2023 - month: 12 - day: 15 - } - homepage: "https://crates.io/crates/const-oid" - identifier { - type: "Archive" - value: "https://static.crates.io/crates/const-oid/const-oid-0.9.6.crate" - version: "0.9.6" + month: 3 + day: 6 } } @@ -54,7 +54,6 @@ const fn eq_case(lhs: &[u8], rhs: &[u8]) -> bool { } /// A query interface for OIDs/Names. -#[derive(Copy, Clone)] pub struct Database<'a>(&'a [(&'a ObjectIdentifier, &'a str)]); impl<'a> Database<'a> { @@ -100,43 +99,6 @@ impl<'a> Database<'a> { None } - - /// Return the list of matched name for the OID. - pub const fn find_names_for_oid(&self, oid: ObjectIdentifier) -> Names<'a> { - Names { - database: *self, - oid, - position: 0, - } - } -} - -/// Iterator returning the multiple names that may be associated with an OID. -pub struct Names<'a> { - database: Database<'a>, - oid: ObjectIdentifier, - position: usize, -} - -impl<'a> Iterator for Names<'a> { - type Item = &'a str; - - fn next(&mut self) -> Option<&'a str> { - let mut i = self.position; - - while i < self.database.0.len() { - let lhs = self.database.0[i].0; - - if lhs.as_bytes().eq(self.oid.as_bytes()) { - self.position = i + 1; - return Some(self.database.0[i].1); - } - - i += 1; - } - - None - } } #[cfg(test)] diff --git a/src/db/gen.rs b/src/db/gen.rs index 9c603d8..74945a4 100644 --- a/src/db/gen.rs +++ b/src/db/gen.rs @@ -2044,16 +2044,6 @@ pub mod rfc6960 { pub const ID_PKIX_OCSP_EXTENDED_REVOKE: crate::ObjectIdentifier = crate::ObjectIdentifier::new_unwrap("1.3.6.1.5.5.7.48.1.9"); } -pub mod rfc6962 { - pub const GOOGLE: crate::ObjectIdentifier = - crate::ObjectIdentifier::new_unwrap("1.3.6.1.4.1.11129"); - pub const CT_PRECERT_SCTS: crate::ObjectIdentifier = - crate::ObjectIdentifier::new_unwrap("1.3.6.1.4.1.11129.2.4.2"); - pub const CT_PRECERT_POISON: crate::ObjectIdentifier = - crate::ObjectIdentifier::new_unwrap("1.3.6.1.4.1.11129.2.4.3"); - pub const CT_PRECERT_SIGNING_CERT: crate::ObjectIdentifier = - crate::ObjectIdentifier::new_unwrap("1.3.6.1.4.1.11129.2.4.4"); -} pub mod rfc7107 { pub const ID_SMIME: crate::ObjectIdentifier = crate::ObjectIdentifier::new_unwrap("1.2.840.113549.1.9.16"); @@ -2255,38 +2245,6 @@ pub mod rfc8284 { crate::ObjectIdentifier::new_unwrap("1.3.6.1.1.23.1"); pub const JID: crate::ObjectIdentifier = crate::ObjectIdentifier::new_unwrap("1.3.6.1.1.23.2"); } -pub mod rfc8410 { - pub const ID_EDWARDS_CURVE_ALGS: crate::ObjectIdentifier = - crate::ObjectIdentifier::new_unwrap("1.3.101"); - pub const ID_X_25519: crate::ObjectIdentifier = - crate::ObjectIdentifier::new_unwrap("1.3.101.110"); - pub const ID_X_448: crate::ObjectIdentifier = - crate::ObjectIdentifier::new_unwrap("1.3.101.111"); - pub const ID_ED_25519: crate::ObjectIdentifier = - crate::ObjectIdentifier::new_unwrap("1.3.101.112"); - pub const ID_ED_448: crate::ObjectIdentifier = - crate::ObjectIdentifier::new_unwrap("1.3.101.113"); -} -pub mod rfc8894 { - pub const ID_VERI_SIGN: crate::ObjectIdentifier = - crate::ObjectIdentifier::new_unwrap("2.16.840.1.113733"); - pub const ID_PKI: crate::ObjectIdentifier = - crate::ObjectIdentifier::new_unwrap("2.16.840.1.113733.1"); - pub const ID_ATTRIBUTES: crate::ObjectIdentifier = - crate::ObjectIdentifier::new_unwrap("2.16.840.1.113733.1.9"); - pub const ID_MESSAGE_TYPE: crate::ObjectIdentifier = - crate::ObjectIdentifier::new_unwrap("2.16.840.1.113733.1.9.2"); - pub const ID_PKI_STATUS: crate::ObjectIdentifier = - crate::ObjectIdentifier::new_unwrap("2.16.840.1.113733.1.9.3"); - pub const ID_FAIL_INFO: crate::ObjectIdentifier = - crate::ObjectIdentifier::new_unwrap("2.16.840.1.113733.1.9.4"); - pub const ID_SENDER_NONCE: crate::ObjectIdentifier = - crate::ObjectIdentifier::new_unwrap("2.16.840.1.113733.1.9.5"); - pub const ID_RECIPIENT_NONCE: crate::ObjectIdentifier = - crate::ObjectIdentifier::new_unwrap("2.16.840.1.113733.1.9.6"); - pub const ID_TRANSACTION_ID: crate::ObjectIdentifier = - crate::ObjectIdentifier::new_unwrap("2.16.840.1.113733.1.9.7"); -} pub const DB: super::Database<'static> = super::Database(&[ (&rfc1274::TEXT_ENCODED_OR_ADDRESS, "textEncodedORAddress"), (&rfc1274::OTHER_MAILBOX, "otherMailbox"), @@ -4119,10 +4077,6 @@ pub const DB: super::Database<'static> = super::Database(&[ &rfc6960::ID_PKIX_OCSP_EXTENDED_REVOKE, "id-pkix-ocsp-extended-revoke", ), - (&rfc6962::GOOGLE, "google"), - (&rfc6962::CT_PRECERT_SCTS, "ct-precert-scts"), - (&rfc6962::CT_PRECERT_POISON, "ct-precert-poison"), - (&rfc6962::CT_PRECERT_SIGNING_CERT, "ct-precert-signing-cert"), (&rfc7107::ID_SMIME, "id-smime"), (&rfc7107::ID_MOD, "id-mod"), (&rfc7107::ID_CT, "id-ct"), @@ -4231,18 +4185,4 @@ pub const DB: super::Database<'static> = super::Database(&[ ), (&rfc8284::JID_OBJECT, "JIDObject"), (&rfc8284::JID, "jid"), - (&rfc8410::ID_EDWARDS_CURVE_ALGS, "id-edwards-curve-algs"), - (&rfc8410::ID_X_25519, "id-X25519"), - (&rfc8410::ID_X_448, "id-X448"), - (&rfc8410::ID_ED_25519, "id-Ed25519"), - (&rfc8410::ID_ED_448, "id-Ed448"), - (&rfc8894::ID_VERI_SIGN, "id-VeriSign"), - (&rfc8894::ID_PKI, "id-pki"), - (&rfc8894::ID_ATTRIBUTES, "id-attributes"), - (&rfc8894::ID_MESSAGE_TYPE, "id-messageType"), - (&rfc8894::ID_PKI_STATUS, "id-pkiStatus"), - (&rfc8894::ID_FAIL_INFO, "id-failInfo"), - (&rfc8894::ID_SENDER_NONCE, "id-senderNonce"), - (&rfc8894::ID_RECIPIENT_NONCE, "id-recipientNonce"), - (&rfc8894::ID_TRANSACTION_ID, "id-transactionID"), ]); |