Skip to content

Commit e07cc2d

Browse files
authored
md2: add OID support (#419)
1 parent 479404a commit e07cc2d

4 files changed

Lines changed: 36 additions & 2 deletions

File tree

.github/workflows/md2.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
strategy:
5050
matrix:
5151
rust:
52-
- 1.41.0 # MSRV
52+
- 1.57.0 # MSRV
5353
- stable
5454
steps:
5555
- uses: actions/checkout@v3
@@ -63,3 +63,22 @@ jobs:
6363
- run: cargo test --no-default-features
6464
- run: cargo test
6565
- run: cargo test --all-features
66+
67+
# TODO: merge with test on MSRV bump to 1.57 or higher
68+
test-msrv-41:
69+
runs-on: ubuntu-latest
70+
strategy:
71+
matrix:
72+
rust:
73+
- 1.41.0 # MSRV
74+
- stable
75+
steps:
76+
- uses: actions/checkout@v3
77+
- uses: RustCrypto/actions/cargo-cache@master
78+
- uses: actions-rs/toolchain@v1
79+
with:
80+
profile: minimal
81+
toolchain: ${{ matrix.rust }}
82+
override: true
83+
- run: cargo test --no-default-features
84+
- run: cargo test

md2/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## 0.10.2 (UNRELEASED)
9+
### Added
10+
- Feature-gated OID support ([#419])
11+
12+
[#419]: https://github.com/RustCrypto/hashes/pull/419
13+
814
## 0.10.1 (2022-02-17)
915
### Fixed
1016
- Minimal versions build ([#363])

md2/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ keywords = ["crypto", "md2", "hash", "digest"]
1212
categories = ["cryptography", "no-std"]
1313

1414
[dependencies]
15-
digest = "0.10.3"
15+
digest = "0.10.4"
1616

1717
[dev-dependencies]
1818
digest = { version = "0.10.3", features = ["dev"] }
@@ -21,3 +21,4 @@ hex-literal = "0.2.2"
2121
[features]
2222
default = ["std"]
2323
std = ["digest/std"]
24+
oid = ["digest/oid"]

md2/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
pub use digest::{self, Digest};
3535

3636
use core::fmt;
37+
#[cfg(feature = "oid")]
38+
use digest::const_oid::{AssociatedOid, ObjectIdentifier};
3739
use digest::{
3840
block_buffer::Eager,
3941
consts::U16,
@@ -146,5 +148,11 @@ impl fmt::Debug for Md2Core {
146148
}
147149
}
148150

151+
#[cfg(feature = "oid")]
152+
#[cfg_attr(docsrs, doc(cfg(feature = "oid")))]
153+
impl AssociatedOid for Md2Core {
154+
const OID: ObjectIdentifier = ObjectIdentifier::new_unwrap("1.2.840.113549.2.2");
155+
}
156+
149157
/// MD2 hasher state.
150158
pub type Md2 = CoreWrapper<Md2Core>;

0 commit comments

Comments
 (0)