Skip to content

Toolchain and dependent crate update#14

Merged
sameo merged 4 commits intorivosinc:mainfrom
dgreid:topic/toolchain_update
Apr 8, 2025
Merged

Toolchain and dependent crate update#14
sameo merged 4 commits intorivosinc:mainfrom
dgreid:topic/toolchain_update

Conversation

@dgreid
Copy link
Contributor

@dgreid dgreid commented Apr 7, 2025

update to work with a more recent nightly and use current versions of the crates it depends on.

@dgreid dgreid force-pushed the topic/toolchain_update branch 3 times, most recently from 0771fd3 to da896b8 Compare April 7, 2025 17:24
@dgreid dgreid requested a review from sameo April 7, 2025 18:21
@dgreid dgreid self-assigned this Apr 7, 2025
@dgreid dgreid requested a review from Copilot April 7, 2025 18:21
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 16 out of 17 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • deps.bzl: Language not supported
Comments suppressed due to low confidence (2)

src/x509/extensions/pkix/name/other.rs:23

  • The removal of the test for OtherName may reduce test coverage. Consider retaining or migrating the test to ensure that encoding and decoding functionality continues to work as expected.
-#[test]

src/x509/certificate.rs:199

  • The API for Certificate::from_layer was changed from returning a DER slice to returning an empty Result. However, the caller in src/layer.rs expects a DER slice to convert into an ArrayVec. This mismatch may lead to unexpected behavior; update the caller code to properly handle the new return type and determine the valid certificate length.
pub fn from_layer<const N: usize, S: SignatureEncoding, C: CompoundDeviceIdentifier<N, S>>(..., certificate_buf: &mut [u8]) -> Result<()> {

src/local_cdi.rs Outdated
/// Public key for the current CDI.
fn public_key(&self) -> [u8; PUBLIC_KEY_LENGTH] {
self.key_pair.public.to_bytes()
self.key_pair.to_bytes()
Copy link

Copilot AI Apr 7, 2025

Choose a reason for hiding this comment

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

Switching from Keypair to SigningKey requires retrieving the public key correctly. Instead of calling to_bytes() on the SigningKey (which returns secret key bytes), use self.key_pair.verify_key().to_bytes() to obtain the public key.

Suggested change
self.key_pair.to_bytes()
self.key_pair.verify_key().to_bytes()

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

@dgreid That seems to be right, we only want the verifying part of the key.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is right, fixed.

I'm impressed, that was a legit good catch

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, it is impressive.

dgreid and others added 4 commits April 7, 2025 14:11
After two years, many crates are out of date and need updating. Doing
them all at once as many have second level dependencies on each other.

This gets everything back to a state that can build with a recent rust
toolchain.

This includes many breaking API changes that required minor reworks.

The transition from `KeyPair` to `SigningKey` caused much of the churn.

Signed-off-by: Dylan Reid <dgreid@rivosinc.com>
The test in other was disabled without the alloc feature, which doesn't
exist. It also depends on hex_literal, which has no way of being
included. Remove it so test runs stop warning about the disabled test.

Signed-off-by: Dylan Reid <dgreid@rivosinc.com>
Remove a clippy lint for converting to an interator for a function that
takes `IntoIterator`.

Signed-off-by: Dylan Reid <dgreid@rivosinc.com>
A recent cargo clippy doesn't like named, but elide-able lifetimes.

Signed-off-by: Dylan Reid <dgreid@rivosinc.com>
@dgreid dgreid force-pushed the topic/toolchain_update branch from da896b8 to edf0877 Compare April 7, 2025 21:13
Copy link
Contributor

@sameo sameo left a comment

Choose a reason for hiding this comment

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

Thanks for the update @dgreid

@sameo sameo merged commit 58961a0 into rivosinc:main Apr 8, 2025
8 checks passed
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.

3 participants