Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Cargo features and code to allow OpenSSL to be used for Crypto #40

Merged
merged 3 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ jobs:
run: rustup component add clippy
- name: Run checks
run: make check

- name: Run explicit openssl checks
run: make check_openssl
- name: Run explicit md5 checks
run: make check_md5
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
check: test lint
check_openssl: lint_with_openssl build_with_openssl test_with_openssl
check_md5: lint_with_md5 build_with_md5 test_with_md5

test:
cargo test
Expand All @@ -17,3 +19,20 @@ fix:
cargo fix --allow-dirty --allow-staged
cargo fmt

build_with_openssl:
cd radius && cargo build --verbose --no-default-features --features openssl

test_with_openssl:
cd radius && cargo test --verbose --no-default-features --features openssl

lint_with_openssl:
cd radius && cargo clippy --verbose --no-default-features --features openssl

build_with_md5:
cd radius && cargo build --verbose --no-default-features --features md5

test_with_md5:
cd radius && cargo test --verbose --no-default-features --features md5

lint_with_md5:
cd radius && cargo clippy --verbose --no-default-features --features md5
8 changes: 7 additions & 1 deletion radius/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@ categories = ["network-programming"]
keywords = ["radius", "async"]

[dependencies]
md5 = "0.7.0"
md5 = { version = "0.7.0", optional = true}
openssl = { version = "0.10", optional = true }
chrono = "0.4"
rand = "0.8.3"
num_enum = "0.5.1"
thiserror = "1.0"
log = "0.4.14"
tokio = { version = "1.6.1", features = ["full"] }
async-trait = "0.1.50"

[features]
default = ["md5"]
openssl = ["dep:openssl"]
md5 = ["dep:md5"]
Loading
Loading