Skip to content
4 changes: 2 additions & 2 deletions lib/src/impl_ffi/impl_ffi.rsa_common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ _EvpPKey _importJwkRsaPrivateOrPublicKey(
checkJwk(jwk.d != null, 'd');
final d = readBN(jwk.d!, 'd');
// If present properties p,q,dp,dq,qi enable optional optimizations, see:
// https://tools.ietf.org/html/rfc7518#section-6.3.2
// https://https://www.rfc-editor.org/rfc/rfc7518#section-6.3.2
// However, these are required by Chromes Web Crypto implementation:
// https://chromium.googlesource.com/chromium/src/+/43d62c50b705f88c67b14539e91fd8fd017f70c4/components/webcrypto/algorithms/rsa.cc#82
// They are also required by Web Crypto implementation in Firefox:
Expand Down Expand Up @@ -202,7 +202,7 @@ Map<String, dynamic> _exportJwkRsaPrivateOrPublicKey(
ssl.RSA_get0_key(rsa, ffi.nullptr, ffi.nullptr, d);

// p, q, dp, dq, qi is optional in:
// // https://tools.ietf.org/html/rfc7518#section-6.3.2
// // https://www.rfc-editor.org/rfc/rfc7518#section-6.3.2
// but explicitly required when exporting in Web Crypto.
final p = scope<ffi.Pointer<BIGNUM>>();
final q = scope<ffi.Pointer<BIGNUM>>();
Expand Down
4 changes: 2 additions & 2 deletions lib/src/impl_ffi/impl_ffi.utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ int _numBitsToBytes(int numberOfBits) =>
(numberOfBits ~/ 8) + ((7 + (numberOfBits % 8)) ~/ 8);

/// Decode url-safe base64 witout padding as specified in
/// [RFC 7515 Section 2](https://tools.ietf.org/html/rfc7515#section-2)
/// [RFC 7515 Section 2]( https://www.rfc-editor.org/rfc/rfc7515#section-2)
///
/// Throw [FormatException] mentioning JWK property [prop] on failure.
Uint8List _jwkDecodeBase64UrlNoPadding(String unpadded, String prop) {
Expand All @@ -508,7 +508,7 @@ Uint8List _jwkDecodeBase64UrlNoPadding(String unpadded, String prop) {
}

/// Encode url-safe base64 witout padding as specified in
/// [RFC 7515 Section 2](https://tools.ietf.org/html/rfc7515#section-2)
/// [RFC 7515 Section 2](https://www.rfc-editor.org/rfc/rfc7515#section-2)
String _jwkEncodeBase64UrlNoPadding(List<int> data) {
final padded = base64Url.encode(data);
final i = padded.indexOf('=');
Expand Down
2 changes: 1 addition & 1 deletion lib/src/jsonwebkey.dart
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ final class JsonWebKey {
/// See also "oth" in [RFC 7518 Section 6.3.2.7].
///
/// [1]: https://www.w3.org/TR/WebCryptoAPI/#JsonWebKey-dictionary
/// [2]: https://tools.ietf.org/html/rfc7518#section-6.3.2.7
/// [2]: https://www.rfc-editor.org/rfc/rfc7518#section-6.3.2.7
final class RsaOtherPrimesInfo {
String r;
String d;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/testing/webcrypto/rsapss.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ final _testData = [
/// [2]: https://opensource.apple.com/source/CommonCrypto/CommonCrypto-60165.120.1/lib/CommonRSACryptor.c.auto.html
/// [3]: https://opensource.apple.com/source/xnu/xnu-4570.41.2/EXTERNAL_HEADERS/corecrypto/ccrsa.h.auto.html
/// [4]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf
/// [5]: https://tools.ietf.org/html/rfc3447
/// [5]: https://www.rfc-editor.org/rfc/rfc3447
/// [6]: https://tools.ietf.org/html/rfc3447#section-9.1
/// [7]: https://bugs.webkit.org/show_bug.cgi?id=216750
...(nullOnSafari(_testDataWithLongSaltLength) ?? <Map>[]),
Expand Down