bcgit / pc-dart

Pointy Castle - Dart Derived Bouncy Castle APIs
MIT License
230 stars 120 forks source link

3.9.0 Error #234

Closed ruwiss closed 2 months ago

ruwiss commented 3 months ago
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/pointycastle-3.9.0/lib/macs/cbc_block_cipher_mac.dart:103:46: Warning: Operand of null-aware operation '!' has type 'Padding' which excludes null.
 - 'Padding' is from 'package:pointycastle/api.dart' ('../../../../AppData/Local/Pub/Cache/hosted/pub.dev/pointycastle-3.9.0/lib/api.dart').
    var paddingName = _padding != null ? '/${_padding!.algorithmName}' : '';
                                             ^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/pointycastle-3.9.0/lib/macs/cbc_block_cipher_mac.dart:203:7: Warning: Operand of null-aware operation '!' has type 'Padding' which excludes null.
 - 'Padding' is from 'package:pointycastle/api.dart' ('../../../../AppData/Local/Pub/Cache/hosted/pub.dev/pointycastle-3.9.0/lib/api.dart').
      _padding!.addPadding(_buf, _bufOff);
      ^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/pointycastle-3.9.0/lib/signers/ecdsa_signer.dart:94:41: Warning: Operand of null-aware operation '!' has type 'Mac' which excludes null.
 - 'Mac' is from 'package:pointycastle/api.dart' ('../../../../AppData/Local/Pub/Cache/hosted/pub.dev/pointycastle-3.9.0/lib/api.dart').
      kCalculator = _RFC6979KCalculator(_kMac!, n, _pvkey!.d!, message);
                                        ^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/pointycastle-3.9.0/lib/signers/ecdsa_signer.dart:166:7: Warning: Operand of null-aware operation '!' has type 'Digest' which excludes null.
 - 'Digest' is from 'package:pointycastle/api.dart' ('../../../../AppData/Local/Pub/Cache/hosted/pub.dev/pointycastle-3.9.0/lib/api.dart').
      _digest!.reset();
      ^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/pointycastle-3.9.0/lib/signers/ecdsa_signer.dart:167:14: Warning: Operand of null-aware operation '!' has type 'Digest' which excludes null.
 - 'Digest' is from 'package:pointycastle/api.dart' ('../../../../AppData/Local/Pub/Cache/hosted/pub.dev/pointycastle-3.9.0/lib/api.dart').
      return _digest!.process(message);
             ^
Ephenodrom commented 3 months ago

@ruwiss Can you please try to use the version 3.8.0 ? If it works, the problem is related to the min sdk version set to 3.2.0.

ruwiss commented 3 months ago

I'm using version 3.7.3, no problems.

Ephenodrom commented 3 months ago

@ruwiss Would you mind trying 3.8.0 in your dependency ovverride to see if the error is connected to the release 3.9.0 ?

sososdk commented 3 months ago

This is a warning. Because of the extra ! in dart 3.2.0

kushalmahapatro commented 3 months ago

I too had this same error while debugging a dart cli application. adding pointycastle: 3.8.0 to dependency_overrides solved it.

dependency_overrides:
  pointycastle: 3.8.0
SaltH2OFish commented 2 months ago

I too had this same error while debugging a dart cli application. adding pointycastle: 3.8.0 to dependency_overrides solved it.

dependency_overrides:
  pointycastle: 3.8.0

This solved it for me as well. Thanks for the recommendation.