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

Update ring requirement from 0.14.6 to 0.16.0 #37

Merged
merged 3 commits into from
Jul 19, 2019

Conversation

dependabot-preview[bot]
Copy link
Contributor

Updates the requirements on ring to permit the latest version.

Commits

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot ignore this [patch|minor|major] version will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it). To ignore the version in this PR you can just close it
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
  • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot dashboard:

  • Update frequency (including time of day and day of week)
  • Pull request limits (per update run and/or open at any time)
  • Out-of-range updates (receive only lockfile updates, if desired)
  • Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

Updates the requirements on [ring](https://github.com/briansmith/ring) to permit the latest version.
- [Release notes](https://github.com/briansmith/ring/releases)
- [Commits](https://github.com/briansmith/ring/commits)

Signed-off-by: dependabot-preview[bot] <[email protected]>
@dependabot-preview dependabot-preview bot requested a review from djmitche as a code owner July 19, 2019 05:29
@dependabot-preview dependabot-preview bot added the dependencies Pull requests that update a dependency file label Jul 19, 2019
@djmitche
Copy link
Collaborator

From #35, Looks like this needs a newer stable rust..

@djmitche
Copy link
Collaborator

Needs even a bit more work:

error: Could not compile `hawk`.
warning: build failed, waiting for other jobs to finish...
error[E0599]: no method named `digest_algorithm` found for type `ring::hmac::Key` in the current scope
  --> src/crypto/ring.rs:21:38
   |
21 |         let mut mac = vec![0; self.0.digest_algorithm().output_len];
   |                                      ^^^^^^^^^^^^^^^^

error[E0599]: no method named `fill` found for type `fn(()) -> ring::rand::SystemRandom {ring::rand::SystemRandom}` in the current scope
  --> src/crypto/ring.rs:48:34
   |
48 |         ring::rand::SystemRandom.fill(output)?;
   |                                  ^^^^
   |
   = note: ring::rand::SystemRandom is a function, perhaps you wish to call it
   = note: the method `fill` exists but the following trait bounds were not satisfied:
           `fn(()) -> ring::rand::SystemRandom {ring::rand::SystemRandom} : ring::rand::SecureRandom`

error[E0277]: `?` couldn't convert the error to `crypto::CryptoError`
  --> src/crypto/ring.rs:57:59
   |
57 |         let k = hmac::SigningKey::new(algorithm.try_into()?, key);
   |                                                           ^ the trait `std::convert::From<std::convert::Infallible>` is not implemented for `crypto::CryptoError`
   |
   = help: the following implementations were found:
             <crypto::CryptoError as std::convert::From<ring::error::Unspecified>>
   = note: required by `std::convert::From::from`

error[E0277]: the trait bound `ring::hmac::Algorithm: std::convert::From<credentials::DigestAlgorithm>` is not satisfied
  --> src/crypto/ring.rs:57:49
   |
57 |         let k = hmac::SigningKey::new(algorithm.try_into()?, key);
   |                                                 ^^^^^^^^ the trait `std::convert::From<credentials::DigestAlgorithm>` is not implemented for `ring::hmac::Algorithm`
   |
   = note: required because of the requirements on the impl of `std::convert::Into<ring::hmac::Algorithm>` for `credentials::DigestAlgorithm`
   = note: required because of the requirements on the impl of `std::convert::TryFrom<credentials::DigestAlgorithm>` for `ring::hmac::Algorithm`
   = note: required because of the requirements on the impl of `std::convert::TryInto<ring::hmac::Algorithm>` for `credentials::DigestAlgorithm`

warning: unused import: `ring::rand::SecureRandom`
  --> src/crypto/ring.rs:47:13
   |
47 |         use ring::rand::SecureRandom;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: #[warn(unused_imports)] on by default

error: aborting due to 5 previous errors

@djmitche djmitche requested review from eoger and removed request for djmitche July 19, 2019 15:10
@djmitche
Copy link
Collaborator

I'm interested in feedback on #38 too..

Copy link
Contributor

@eoger eoger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@@ -79,3 +86,15 @@ impl TryFrom<DigestAlgorithm> for &'static digest::Algorithm {
}
}
}

impl TryFrom<DigestAlgorithm> for hmac::Algorithm {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need the TryFrom impl bellow?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, both are used.

@@ -11,14 +11,20 @@ impl From<ring::error::Unspecified> for CryptoError {
}
}

impl From<std::convert::Infallible> for CryptoError {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For completeness, why did we add this?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The most accurate answer is "the compiler told me to". I tried looking through the ring commits to see what breaking changes had occurred, and 50 commits in I had no idea.

But more precisely, one of those try_from()?'s returns Result<, Infallible>, and this impl made the types check out in that case. If there's a better approach I'm all 👀 :)

@djmitche djmitche merged commit 911ed11 into master Jul 19, 2019
@dependabot-preview dependabot-preview bot deleted the dependabot/cargo/ring-0.16.0 branch July 19, 2019 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants