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

Use crypto-hash to calculate SHA256 #4542

Merged
merged 2 commits into from
Sep 29, 2017
Merged

Use crypto-hash to calculate SHA256 #4542

merged 2 commits into from
Sep 29, 2017

Conversation

equal-l2
Copy link
Contributor

crypto-hash is an abstraction library for native hash libraries.
It uses CryptoAPI on Windows, CommonCrypto on macOS, and OpenSSL on *nix.

This PR will also remove openssl and advapi32-sys from dependencies since they are only used for calculating SHA256, which is superseded by crypto-hash.
(crypto-hash itself uses openssl and advapi32-sys though)

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @matklad (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@matklad
Copy link
Member

matklad commented Sep 27, 2017

@alexcrichton could we use a pure rust crate for SHA256 calculations? It seems like there's little reason to use native libraries for hashes specifically.

@matklad
Copy link
Member

matklad commented Sep 27, 2017

I believe https://github.com/RustCrypto/hashes computes sha256 natively.

@equal-l2
Copy link
Contributor Author

Since I made this PR to reduce OpenSSL dependency on macOS, pure-rust implementation is also fine to me.
I'll wait for decision anyway.

@alexcrichton
Copy link
Member

Thanks for the PR! It seems like the only major change here though is to not use OpenSSL on OSX? I think that we still have to pull it in anyway because of libssh2, right?

@equal-l2
Copy link
Contributor Author

@alexcrichton Yes, we'll still need OpenSSL for libssh2, but I want this change so that we can remove OpenSSL dependency on macOS once libssh2 supports macOS' Security Framework in future.

@equal-l2
Copy link
Contributor Author

@alexcrichton How do you think about pure-rust implementation for SHA256?

@matklad
Copy link
Member

matklad commented Sep 28, 2017

alexcrichton How do you think about pure-rust implementation for SHA256?

@equal-l2 let's not wait on alexcrichton and just use the sha2 crate from https://github.com/RustCrypto :) It's the thing that is used by rustup, so it should be good for Cargo as well! :)

@equal-l2
Copy link
Contributor Author

@matklad OK, then should I do that in new PR?

@matklad
Copy link
Member

matklad commented Sep 28, 2017

OK, then should I do that in new PR?

You can create a new PR, or force push this one, either is fine!

@equal-l2
Copy link
Contributor Author

You can create a new PR, or force push this one, either is fine!

Then I will create a new PR soon.

@equal-l2
Copy link
Contributor Author

Created new PR
#4545

@equal-l2 equal-l2 reopened this Sep 29, 2017
@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Sep 29, 2017

📌 Commit 8346104 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Sep 29, 2017

⌛ Testing commit 8346104 with merge 0ac5362...

bors added a commit that referenced this pull request Sep 29, 2017
Use crypto-hash to calculate SHA256

`crypto-hash` is an abstraction library for native hash libraries.
It uses CryptoAPI on Windows, CommonCrypto on macOS, and OpenSSL on *nix.

This PR will also remove `openssl` and `advapi32-sys` from dependencies since they are only used for calculating SHA256, which is superseded by `crypto-hash`.
(`crypto-hash` itself uses `openssl` and `advapi32-sys` though)
@bors
Copy link
Contributor

bors commented Sep 29, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 0ac5362 to master...

@bors bors merged commit 8346104 into rust-lang:master Sep 29, 2017
@equal-l2 equal-l2 deleted the sha256-crypto-hash branch October 1, 2017 07:43
@ehuss ehuss added this to the 1.22.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants