Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/src/boringssl/lookup/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ String get libraryFileName {
if (Platform.isMacOS) {
return 'lib$libraryName.dylib';
}
// coverage:ignore-start
throw UnsupportedError(
'Platform ${Platform.operatingSystem} is unsupported or embed '
'the binary webcrypto library for package:webcrypto',
);
// coverage:ignore-end
}

/// Look for the webcrypto binary library in the `.dart_tool/webcrypto/` folder.
Expand Down
6 changes: 6 additions & 0 deletions lib/src/impl_ffi/impl_ffi.aes_common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ Uint8List _aesImportRawKey(List<int> keyData) {
if (keyData.length == 24) {
// 192-bit AES is intentionally unsupported, see https://crbug.com/533699
// If not supported in Chrome, there is not reason to support it in Dart.
// coverage:ignore-start
throw UnsupportedError('192-bit AES keys are not supported');
// coverage:ignore-end
}
if (keyData.length != 16 && keyData.length != 32) {
throw const FormatException('keyData for AES must be 128 or 256 bits');
Expand All @@ -43,7 +45,9 @@ Uint8List _aesImportJwkKey(
if (keyData.length == 24) {
// 192-bit AES is intentionally unsupported, see https://crbug.com/533699
// If not supported in Chrome, there is not reason to support it in Dart.
// coverage:ignore-start
throw UnsupportedError('192-bit AES keys are not supported');
// coverage:ignore-end
}
checkJwk(
keyData.length == 16 || keyData.length == 32,
Expand Down Expand Up @@ -82,7 +86,9 @@ Uint8List _aesGenerateKey(int length) {
if (length == 192) {
// 192-bit AES is intentionally unsupported, see https://crbug.com/533699
// If not supported in Chrome, there is not reason to support it in Dart.
// coverage:ignore-start
throw UnsupportedError('192-bit AES keys are not supported');
// coverage:ignore-end
}
if (length != 128 && length != 256) {
throw const FormatException('keyData for AES must be 128 or 256 bits');
Expand Down
6 changes: 6 additions & 0 deletions lib/src/impl_ffi/impl_ffi.ec_common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ int _ecCurveToNID(EllipticCurve curve) {
return NID_secp521r1;
}
// This should never happen!
// coverage:ignore-start
throw UnsupportedError('curve "$curve" is not supported');
// coverage:ignore-end
}

/// Get [EllipticCurve] from matching BoringSSL `ssl.NID_...`.
Expand All @@ -41,7 +43,9 @@ EllipticCurve _ecCurveFromNID(int nid) {
return EllipticCurve.p521;
}
// This should never happen!
// coverage:ignore-start
throw operationError('internal error detecting curve');
// coverage:ignore-end
}

String _ecCurveToJwkCrv(EllipticCurve curve) {
Expand All @@ -55,7 +59,9 @@ String _ecCurveToJwkCrv(EllipticCurve curve) {
return 'P-521';
}
// This should never happen!
// coverage:ignore-start
throw UnsupportedError('curve "$curve" is not supported');
// coverage:ignore-end
}

/// Perform some post-import validation for EC keys.
Expand Down
2 changes: 2 additions & 0 deletions lib/src/impl_ffi/impl_ffi.ecdsa.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ String _ecdsaCurveToJwkAlg(EllipticCurve curve) {
return 'ES512';
}
// This should never happen!
// coverage:ignore-start
throw UnsupportedError('curve "$curve" is not supported');
// coverage:ignore-end
}

Future<EcdsaPrivateKeyImpl> ecdsaPrivateKey_importPkcs8Key(
Expand Down
2 changes: 2 additions & 0 deletions lib/src/impl_js/impl_js.utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ String _curveToName(EllipticCurve curve) {
return 'P-521';
}
// This should never happen.
// coverage:ignore-start
// ignore: dead_code
throw AssertionError('Unknown curve "$curve"');
// coverage:ignore-end
}

Object _translateDomException(
Expand Down
1 change: 1 addition & 0 deletions lib/src/impl_stub/impl_stub.aescbc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// coverage:ignore-file
part of 'impl_stub.dart';

final class _StaticAesCbcSecretKeyImpl implements StaticAesCbcSecretKeyImpl {
Expand Down
1 change: 1 addition & 0 deletions lib/src/impl_stub/impl_stub.aesctr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// coverage:ignore-file
part of 'impl_stub.dart';

final class _StaticAesCtrSecretKeyImpl implements StaticAesCtrSecretKeyImpl {
Expand Down
1 change: 1 addition & 0 deletions lib/src/impl_stub/impl_stub.aesgcm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// coverage:ignore-file
part of 'impl_stub.dart';

final class _StaticAesGcmSecretKeyImpl implements StaticAesGcmSecretKeyImpl {
Expand Down
1 change: 1 addition & 0 deletions lib/src/impl_stub/impl_stub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// coverage:ignore-file
library;

import 'dart:typed_data';
Expand Down
1 change: 1 addition & 0 deletions lib/src/impl_stub/impl_stub.digest.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// coverage:ignore-file
part of 'impl_stub.dart';

final class _HashImpl implements HashImpl {
Expand Down
1 change: 1 addition & 0 deletions lib/src/impl_stub/impl_stub.ecdh.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// coverage:ignore-file
part of 'impl_stub.dart';

final class _StaticEcdhPrivateKeyImpl implements StaticEcdhPrivateKeyImpl {
Expand Down
1 change: 1 addition & 0 deletions lib/src/impl_stub/impl_stub.ecdsa.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// coverage:ignore-file
part of 'impl_stub.dart';

final class _StaticEcdsaPrivateKeyImpl implements StaticEcdsaPrivateKeyImpl {
Expand Down
1 change: 1 addition & 0 deletions lib/src/impl_stub/impl_stub.hkdf.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// coverage:ignore-file
part of 'impl_stub.dart';

final class _StaticHkdfSecretKeyImpl implements StaticHkdfSecretKeyImpl {
Expand Down
1 change: 1 addition & 0 deletions lib/src/impl_stub/impl_stub.hmac.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// coverage:ignore-file
part of 'impl_stub.dart';

final class _StaticHmacSecretKeyImpl implements StaticHmacSecretKeyImpl {
Expand Down
1 change: 1 addition & 0 deletions lib/src/impl_stub/impl_stub.pbkdf2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// coverage:ignore-file
part of 'impl_stub.dart';

final class _StaticPbkdf2SecretKeyImpl implements StaticPbkdf2SecretKeyImpl {
Expand Down
1 change: 1 addition & 0 deletions lib/src/impl_stub/impl_stub.random.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// coverage:ignore-file
part of 'impl_stub.dart';

final class _RandomImpl implements RandomImpl {
Expand Down
1 change: 1 addition & 0 deletions lib/src/impl_stub/impl_stub.rsaoaep.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// coverage:ignore-file
part of 'impl_stub.dart';

final class _StaticRsaOaepPrivateKeyImpl
Expand Down
1 change: 1 addition & 0 deletions lib/src/impl_stub/impl_stub.rsapss.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// coverage:ignore-file
part of 'impl_stub.dart';

final class _StaticRsaPssPrivateKeyImpl implements StaticRsaPssPrivateKeyImpl {
Expand Down
1 change: 1 addition & 0 deletions lib/src/impl_stub/impl_stub.rsassapkcs1v15.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// coverage:ignore-file
part of 'impl_stub.dart';

final class _StaticRsaSsaPkcs1V15PrivateKeyImpl
Expand Down