aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-07 07:12:44 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-07 07:12:44 +0000
commit3d81bfab7415f8d63ea1fa548adb588b75bf5a75 (patch)
tree7ddd8c6c73ff2332ba5f3fa439b9a67776982c4e
parent100eca1e1bccf97bc753c180c2ea4f91b09fd53c (diff)
parentcecbe37b2aef2a31facd506788c788cbc370fa8f (diff)
downloadder-parser-aml_odp_341610000.tar.gz
Snap for 10453938 from cecbe37b2aef2a31facd506788c788cbc370fa8f to mainline-odp-releaseaml_odp_341717000aml_odp_341610000
Change-Id: Ia9d68d3d74f1b1d4fac1facacc76628065ce1aa8
-rw-r--r--.cargo_vcs_info.json7
-rw-r--r--Android.bp9
-rw-r--r--CHANGELOG.md6
-rw-r--r--Cargo.toml4
-rw-r--r--Cargo.toml.orig4
-rw-r--r--METADATA11
-rw-r--r--OWNERS2
-rw-r--r--TEST_MAPPING22
-rw-r--r--cargo2android.json6
-rw-r--r--src/ber/multi.rs2
-rw-r--r--src/ber/parser.rs14
-rw-r--r--src/der/multi.rs2
12 files changed, 43 insertions, 46 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 4eaee56..df3c872 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,6 @@
{
"git": {
- "sha1": "7b9b5b84387d7c4707b1abc7a13faba515b7c08e"
- }
-}
+ "sha1": "73273e8d5d2f15b3ee825d3d0b0ba0c1990ac60f"
+ },
+ "path_in_vcs": ""
+} \ No newline at end of file
diff --git a/Android.bp b/Android.bp
index 55296a0..8818cea 100644
--- a/Android.bp
+++ b/Android.bp
@@ -16,6 +16,7 @@ package {
// default license using the 'licenses: [...]' property on targets as needed.
//
// For unused files, consider creating a 'fileGroup' with "//visibility:private"
+
// to attach the license to, and including a comment whether the files may be
// used in the current project.
//
@@ -42,7 +43,7 @@ rust_library {
host_supported: true,
crate_name: "der_parser",
cargo_env_compat: true,
- cargo_pkg_version: "6.0.0",
+ cargo_pkg_version: "6.0.1",
srcs: ["src/lib.rs"],
edition: "2018",
features: [
@@ -57,4 +58,10 @@ rust_library {
"librusticata_macros",
],
proc_macros: ["libder_oid_macro"],
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.virt",
+ ],
+ vendor_available: true,
+ product_available: true,
}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2fa3705..cba3b02 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,12 @@
### Thanks
+## 6.0.1
+
+### Changed/Fixed
+
+- Report number of missing bytes when having a complete header and incomplete data
+
## 6.0.0
This release has several major changes:
diff --git a/Cargo.toml b/Cargo.toml
index 55418dc..c87704d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,7 +12,7 @@
[package]
edition = "2018"
name = "der-parser"
-version = "6.0.0"
+version = "6.0.1"
authors = ["Pierre Chifflier <chifflier@wzdftpd.net>"]
include = ["LICENSE-*", "CHANGELOG.md", "README.md", "UPGRADING.md", ".gitignore", "Cargo.toml", "bench/*.rs", "src/*.rs", "src/ber/*.rs", "src/der/*.rs", "tests/*.rs", "der-oid-macro/Cargo.toml", "der-oid-macro/src/*.rs"]
description = "Parser/encoder for ASN.1 BER/DER data"
@@ -52,7 +52,7 @@ version = "4.0"
version = "0.3"
[dev-dependencies.pretty_assertions]
-version = "0.7"
+version = "1.0"
[dev-dependencies.test-case]
version = "1.0"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 69f5242..bb26655 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -5,7 +5,7 @@ keywords = ["BER","DER","ASN1","parser","nom"]
homepage = "https://github.com/rusticata/der-parser"
repository = "https://github.com/rusticata/der-parser.git"
name = "der-parser"
-version = "6.0.0"
+version = "6.0.1"
authors = ["Pierre Chifflier <chifflier@wzdftpd.net>"]
categories = ["parser-implementations"]
readme = "README.md"
@@ -50,5 +50,5 @@ std = []
[dev-dependencies]
hex-literal = "0.3"
-pretty_assertions = "0.7"
+pretty_assertions = "1.0"
test-case = "1.0"
diff --git a/METADATA b/METADATA
index c30f813..dca90e1 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,14 @@ third_party {
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/der-parser/der-parser-6.0.0.crate"
+ value: "https://static.crates.io/crates/der-parser/der-parser-6.0.1.crate"
}
- version: "6.0.0"
+ version: "6.0.1"
+ # Dual-licensed, using the least restrictive per go/thirdpartylicenses#same.
license_type: NOTICE
last_upgrade_date {
- year: 2021
- month: 9
- day: 27
+ year: 2022
+ month: 12
+ day: 9
}
}
diff --git a/OWNERS b/OWNERS
index 46fc303..45dc4dd 100644
--- a/OWNERS
+++ b/OWNERS
@@ -1 +1 @@
-include platform/prebuilts/rust:/OWNERS
+include platform/prebuilts/rust:master:/OWNERS
diff --git a/TEST_MAPPING b/TEST_MAPPING
index c758e89..32cbf28 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -4,27 +4,5 @@
{
"path": "external/rust/crates/oid-registry"
}
- ],
- "presubmit": [
- {
- "name": "libapkverify.integration_test"
- },
- {
- "name": "libapkverify.test"
- },
- {
- "name": "microdroid_manager_test"
- }
- ],
- "presubmit-rust": [
- {
- "name": "libapkverify.integration_test"
- },
- {
- "name": "libapkverify.test"
- },
- {
- "name": "microdroid_manager_test"
- }
]
}
diff --git a/cargo2android.json b/cargo2android.json
index 95d3b34..cfffddb 100644
--- a/cargo2android.json
+++ b/cargo2android.json
@@ -1,5 +1,9 @@
{
+ "apex-available": [
+ "//apex_available:platform",
+ "com.android.virt"
+ ],
"device": true,
"features": "bigint,std",
"run": true
-} \ No newline at end of file
+}
diff --git a/src/ber/multi.rs b/src/ber/multi.rs
index 5287d47..dc030d2 100644
--- a/src/ber/multi.rs
+++ b/src/ber/multi.rs
@@ -1,6 +1,6 @@
use crate::ber::*;
use crate::error::*;
-use nom::bytes::complete::take;
+use nom::bytes::streaming::take;
use nom::combinator::{all_consuming, complete, cut, map};
use nom::error::ParseError;
use nom::multi::many0;
diff --git a/src/ber/parser.rs b/src/ber/parser.rs
index 81ccef8..24cbfc7 100644
--- a/src/ber/parser.rs
+++ b/src/ber/parser.rs
@@ -280,7 +280,7 @@ fn ber_read_content_utf8string(i: &[u8], len: usize) -> BerResult<BerObjectConte
let (i, bytes) = take(len)(i)?;
let s = core::str::from_utf8(bytes)
.map_err(|_| Err::Error(BerError::StringInvalidCharset))
- .map(|s| BerObjectContent::UTF8String(s))?;
+ .map(BerObjectContent::UTF8String)?;
Ok((i, s))
}
@@ -345,7 +345,7 @@ fn ber_read_content_numericstring<'a>(i: &'a [u8], len: usize) -> BerResult<BerO
}
let s = core::str::from_utf8(bytes)
.map_err(|_| Err::Error(BerError::StringInvalidCharset))
- .map(|s| BerObjectContent::NumericString(s))?;
+ .map(BerObjectContent::NumericString)?;
Ok((i, s))
}
@@ -361,7 +361,7 @@ fn ber_read_content_visiblestring<'a>(i: &'a [u8], len: usize) -> BerResult<BerO
}
let s = core::str::from_utf8(bytes)
.map_err(|_| Err::Error(BerError::StringInvalidCharset))
- .map(|s| BerObjectContent::VisibleString(s))?;
+ .map(BerObjectContent::VisibleString)?;
Ok((i, s))
}
@@ -395,7 +395,7 @@ fn ber_read_content_printablestring<'a>(
}
let s = core::str::from_utf8(bytes)
.map_err(|_| Err::Error(BerError::StringInvalidCharset))
- .map(|s| BerObjectContent::PrintableString(s))?;
+ .map(BerObjectContent::PrintableString)?;
Ok((i, s))
}
@@ -416,7 +416,7 @@ fn ber_read_content_ia5string<'a>(i: &'a [u8], len: usize) -> BerResult<BerObjec
}
let s = core::str::from_utf8(bytes)
.map_err(|_| Err::Error(BerError::StringInvalidCharset))
- .map(|s| BerObjectContent::IA5String(s))?;
+ .map(BerObjectContent::IA5String)?;
Ok((i, s))
}
@@ -432,7 +432,7 @@ fn ber_read_content_utctime<'a>(i: &'a [u8], len: usize) -> BerResult<BerObjectC
}
let s = core::str::from_utf8(bytes)
.map_err(|_| Err::Error(BerError::StringInvalidCharset))
- .map(|s| BerObjectContent::UTCTime(s))?;
+ .map(BerObjectContent::UTCTime)?;
Ok((i, s))
}
@@ -451,7 +451,7 @@ fn ber_read_content_generalizedtime<'a>(
}
let s = core::str::from_utf8(bytes)
.map_err(|_| Err::Error(BerError::StringInvalidCharset))
- .map(|s| BerObjectContent::GeneralizedTime(s))?;
+ .map(BerObjectContent::GeneralizedTime)?;
Ok((i, s))
}
diff --git a/src/der/multi.rs b/src/der/multi.rs
index 6c8931e..f4f22fa 100644
--- a/src/der/multi.rs
+++ b/src/der/multi.rs
@@ -1,7 +1,7 @@
use crate::ber::BerSize;
use crate::der::*;
use crate::error::*;
-use nom::bytes::complete::take;
+use nom::bytes::streaming::take;
use nom::combinator::{all_consuming, complete, cut, map};
use nom::error::ParseError;
use nom::multi::many0;