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

Warnings on startup #24

Closed
lukehutch opened this issue Aug 22, 2023 · 10 comments
Closed

Warnings on startup #24

lukehutch opened this issue Aug 22, 2023 · 10 comments

Comments

@lukehutch
Copy link

I get the following warnings on startup, after upgrading to the latest version of x509:

../../../.pub-cache/hosted/pub.dev/x509-0.2.3/lib/src/x509_base.dart:176:59: Warning: Operand of null-aware operation '!' has type 'Uint8List' which excludes null.
 - 'Uint8List' is from 'dart:typed_data'.
                (sequence.elements[2] as ASN1OctetString).contentBytes()!),
                                                          ^
../../../.pub-cache/hosted/pub.dev/x509-0.2.3/lib/src/x509_base.dart:195:62: Warning: Operand of null-aware operation '!' has type 'Uint8List' which excludes null.
 - 'Uint8List' is from 'dart:typed_data'.
        algorithm, (sequence.elements[1] as ASN1OctetString).contentBytes()!);
                                                             ^
../../../.pub-cache/hosted/pub.dev/x509-0.2.3/lib/src/certificate.dart:137:19: Warning: Operand of null-aware operation '!' has type 'BigInt' which excludes null.
 - 'BigInt' is from 'dart:core'.
      version = e.valueAsBigInteger!.toInt() + 1;
                  ^
../../../.pub-cache/hosted/pub.dev/x509-0.2.3/lib/src/certificate.dart:154:32: Warning: Operand of null-aware operation '!' has type 'Uint8List' which excludes null.
 - 'Uint8List' is from 'dart:typed_data'.
            ex = (ASN1Parser(o.contentBytes()!).nextObject() as ASN1Sequence)
                               ^
../../../.pub-cache/hosted/pub.dev/x509-0.2.3/lib/src/certificate.dart:164:52: Warning: Operand of null-aware operation '!' has type 'BigInt' which excludes null.
 - 'BigInt' is from 'dart:core'.
        serialNumber: (elements[0] as ASN1Integer).valueAsBigInteger!.toInt(),
                                                   ^
../../../.pub-cache/hosted/pub.dev/x509-0.2.3/lib/src/extension.dart:47:54: Warning: Operand of null-aware operation '!' has type 'Uint8List' which excludes null.
 - 'Uint8List' is from 'dart:typed_data'.
            ASN1Parser(sequence.elements[octetIndex].contentBytes()!)
                                                     ^
../../../.pub-cache/hosted/pub.dev/x509-0.2.3/lib/src/extension.dart:355:16: Warning: Operand of null-aware operation '!' has type 'bool' which excludes null.
        cA = o.booleanValue!;
               ^
../../../.pub-cache/hosted/pub.dev/x509-0.2.3/lib/src/util.dart:39:50: Warning: Operand of null-aware operation '!' has type 'Uint8List' which excludes null.
 - 'Uint8List' is from 'dart:typed_data'.
  var privateKey = toBigInt(sequence.elements[1].contentBytes()!);
                                                 ^
../../../.pub-cache/hosted/pub.dev/x509-0.2.3/lib/src/util.dart:41:32: Warning: Operand of null-aware operation '!' has type 'Uint8List' which excludes null.
 - 'Uint8List' is from 'dart:typed_data'.
  var l = sequence.elements[1].contentBytes()!.length;
                               ^
../../../.pub-cache/hosted/pub.dev/x509-0.2.3/lib/src/util.dart:55:45: Warning: Operand of null-aware operation '!' has type 'Uint8List' which excludes null.
 - 'Uint8List' is from 'dart:typed_data'.
    var e = ASN1Parser(sequence.elements[i].contentBytes()!).nextObject()
                                            ^
../../../.pub-cache/hosted/pub.dev/x509-0.2.3/lib/src/util.dart:101:55: Warning: Operand of null-aware operation '!' has type 'BigInt' which excludes null.
 - 'BigInt' is from 'dart:core'.
  var modulus = (sequence.elements[0] as ASN1Integer).valueAsBigInteger!;
                                                      ^
../../../.pub-cache/hosted/pub.dev/x509-0.2.3/lib/src/util.dart:102:56: Warning: Operand of null-aware operation '!' has type 'BigInt' which excludes null.
 - 'BigInt' is from 'dart:core'.
  var exponent = (sequence.elements[1] as ASN1Integer).valueAsBigInteger!;
                                                       ^
@kmcgill88
Copy link

Same here.

x509 version 0.2.3
Dart SDK version: 3.1.0 (stable) (Tue Aug 15 21:33:36 2023 +0000) on "macos_x64"

@faithoflifedev
Copy link
Contributor

@lukehutch , @kmcgill88 , I'm seeing the same problem, have you found a work-around?

Dart SDK version: 3.1.0 (stable) (Tue Aug 15 21:33:36 2023 +0000) on "macos_arm64"

@kmcgill88
Copy link

No, for now, I've just ignored the warning @faithoflifedev 🫤

@faithoflifedev
Copy link
Contributor

@kmcgill88 , I just submitted a PR - #25 - that removes the warning.

@faithoflifedev
Copy link
Contributor

@kmcgill88, I also added

dependency_overrides:
  x509:
    git: https://github.com/faithoflifedev/x509.git

to my project to remove the warnings, until the x509 package is updated and republished.

@eximius313
Copy link

The issue is still there.
What are the reasons for not merging this PR?

@rbellens
Copy link
Contributor

the pr is now merged and released.

@eximius313
Copy link

Awesome, thanks!

@lukehutch
Copy link
Author

@rbellens you missed one:

../../../.pub-cache/hosted/pub.dev/x509-0.2.4/lib/src/extension.dart:45:48: Warning: Operand of null-aware operation '!' has type 'Uint8List' which excludes null.
 - 'Uint8List' is from 'dart:typed_data'.
      ASN1Parser(sequence.elements[octetIndex].contentBytes()!).nextObject(),

@kevan-mtl
Copy link

yep same issue for me @lukehutch !

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

No branches or pull requests

6 participants