Skip to content

Commit

Permalink
Merge pull request #40 from ramaravishankar/add-openssl
Browse files Browse the repository at this point in the history
Add Cargo features and code to allow OpenSSL to be used for Crypto
  • Loading branch information
moznion authored Jan 15, 2024
2 parents b547a5f + 4c5affd commit 14164d8
Show file tree
Hide file tree
Showing 6 changed files with 473 additions and 11 deletions.
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

0 comments on commit 14164d8

Please sign in to comment.