Conversation
nss-rs 0.16 changes the public key key_data() accessor to return &[u8] instead of Vec<u8>, and drops the p11 re-export of AES_BLOCK_SIZE. Call .to_vec() at the two key_data() sites and use a literal AES block size (as the openssl backend already does). This builds against both older and newer nss-rs.
mxinden-bot
force-pushed
the
nss-rs-0.16-key-data
branch
from
September 22, 2026 10:55
1f0670c to
14bbffe
Compare
mxinden
marked this pull request as ready for review
September 22, 2026 11:12
micolous
reviewed
Sep 22, 2026
|
|
||
| // nss-rs exposes these as raw bindgen u32 constants; shadow as usize for ergonomic use. | ||
| const AES_BLOCK_SIZE: usize = nss_rs::p11::AES_BLOCK_SIZE as usize; | ||
| const AES_BLOCK_SIZE: usize = 16; |
Collaborator
There was a problem hiding this comment.
Nit: I wonder if this is a similar issue to https://bugzilla.mozilla.org/show_bug.cgi?id=2071649, triggered by https://phabricator.services.mozilla.com/D319399, and needs a fix in nss-rs instead?
(Though this would also need an nss-rs release with that fix, so we can accept this for 0.16.1.)
micolous
reviewed
Sep 22, 2026
| # Crypto backends | ||
| openssl-sys = { version = "0.9", optional = true} | ||
| openssl = { version = "0.10", optional = true} | ||
| nss-rs = { git = "https://github.com/mozilla/nss-rs", version = ">=0.12", optional = true } |
Collaborator
There was a problem hiding this comment.
The nss-rs dependency specifier needs to be updated as well, ideally pointing at mozilla/nss-rs@ba8a3f6 (the 0.16.1 release), as otherwise it'll pull from HEAD.
micolous
requested changes
Sep 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
nss-rs 0.16 changes the public key
key_data()accessor to return&[u8]instead ofVec<u8>. Call.to_vec()at the two use sites. This also builds against older nss-rs, wherekey_data()returnsVec<u8>. In addition nss-rs no longer exposesAES_BLOCK_SIZE. Instead, definition is pulled into authenticator-rs.For future similar changes in nss-rs, I suggest adding a new method, e.g.
key_data_borrowed, leaving the old (herekey_data) as is, thus not introducing a breaking change.Includes a second commit to bump the crate version to
v0.6.1. @jschanck let me know if you would prefer a separate pull request.