Skip to content

Commit

Permalink
Remove openssl as dev-dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Oct 6, 2023
1 parent 3ce0984 commit cca9649
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
3 changes: 0 additions & 3 deletions aws-lc-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,5 @@ bindgen = { version = "0.68.1" }
libc = "0.2"
paste = "1.0.11"

[dev-dependencies]
openssl = { version = "0.10" }

[package.metadata.aws-lc-sys]
commit-hash = "aa90e509f2e940916fbe9fdd469a4c90c51824f6"
23 changes: 3 additions & 20 deletions aws-lc-sys/tests/sanity-tests.rs
Original file line number Diff line number Diff line change
@@ -1,30 +1,13 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC

use std::mem::MaybeUninit;

fn sha1_tester(input: &[u8]) -> [u8; 20] {
let mut hash = MaybeUninit::<[u8; 20]>::uninit();

#[test]
fn test_fips_mode() {
unsafe {
aws_lc_sys::SHA1(input.as_ptr(), input.len(), hash.as_mut_ptr().cast());
hash.assume_init()
assert_eq!(aws_lc_sys::FIPS_mode(), 0);
}
}

fn compare(result: &[u8], expected_result: &[u8]) {
println!("Comparing: {result:?} to {expected_result:?}");
assert_eq!(result, expected_result);
}

#[test]
fn sha1() {
let input1 = b"hello";
let result1 = sha1_tester(input1);
let openssl_result1 = openssl::sha::sha1(input1);
compare(&result1, &openssl_result1);
}

#[test]
fn error_checking() {
unsafe {
Expand Down

0 comments on commit cca9649

Please sign in to comment.