Skip to content

Commit 1eec5c1

Browse files
committed
remove the ffi feature
1 parent 257a3d7 commit 1eec5c1

File tree

5 files changed

+4
-10
lines changed

5 files changed

+4
-10
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 0.3.6
2+
- Remove the "ffi" feature as it was incompatible with the structs. Passing them as an opaque pointer is a better idea.
3+
14
## 0.2.0
25
- Support parsing an HOTP/TOTP instance from an otpauth URI (Thanks to [@orion78fr](https://github.com/orion78fr))
36
- Add in an "ffi" feature to make all structs & enums C-compatible with the `#[repr(C)]` attribute

Cargo.toml

+1-5
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,9 @@ license = "MIT"
77
keywords = ["otp", "hotp", "totp", "otpauth"]
88
categories = ["cryptography"]
99
authors = ["Tejas Mehta <[email protected]>"]
10-
version = "0.2.0"
10+
version = "0.3.0"
1111
edition = "2021"
1212

13-
[features]
14-
default = []
15-
ffi = []
16-
1713
[dependencies]
1814
hmac = "0.12.0"
1915
sha-1 = "0.10.0"

src/hotp.rs

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use crate::util::{base32_decode, get_code, hash_generic, MacDigest};
1818
/// [RFC4226]: https://datatracker.ietf.org/doc/html/rfc4226
1919
2020
#[derive(Debug, Clone, Hash)]
21-
#[cfg_attr(feature = "ffi", repr(C))]
2221
pub struct HOTP {
2322
/// The secret key used in the HMAC process.
2423
///

src/totp.rs

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use crate::util::{base32_decode, get_code, hash_generic, MacDigest};
1616
///
1717
/// [RFC6238]: https://datatracker.ietf.org/doc/html/rfc6238
1818
#[derive(Debug, Clone, Hash)]
19-
#[cfg_attr(feature = "ffi", repr(C))]
2019
pub struct TOTP {
2120
/// The secret key used in the HMAC process.
2221
///

src/util.rs

-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use crate::totp::TOTP;
2020
///
2121
/// [RFC6238]: https://datatracker.ietf.org/doc/html/rfc6238
2222
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
23-
#[cfg_attr(feature = "ffi", repr(C))]
2423
pub enum MacDigest {
2524
SHA1,
2625
SHA256,
@@ -82,7 +81,6 @@ pub(crate) fn base32_decode(data: &str) -> Option<Vec<u8>> {
8281
/// If an [HOTP] instance is returned, a second value is returned
8382
/// signifying the counter's value.
8483
#[derive(Debug)]
85-
#[cfg_attr(feature = "ffi", repr(C))]
8684
pub enum ParseResult {
8785
TOTP(TOTP),
8886
HOTP(HOTP, u64),
@@ -94,7 +92,6 @@ pub enum ParseResult {
9492
/// in an enum. The returned error may have an associated message or
9593
/// [url::ParseError] with more information
9694
#[derive(Debug)]
97-
#[cfg_attr(feature = "ffi", repr(C))]
9895
pub enum ParseError {
9996
UriParseError(url::ParseError),
10097
WrongScheme(String),

0 commit comments

Comments
 (0)