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

Remove openssl as dev-dependency #238

Merged
merged 1 commit into from
Oct 6, 2023
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
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