PointyCastle / pointycastle

Moved into the Bouncy Castle project: https://github.com/bcgit/pc-dart
MIT License
270 stars 76 forks source link

AOEP unit tests failing #173

Open stevenroose opened 5 years ago

stevenroose commented 5 years ago

It seems like they never worked in the first place.

@duncanhoggan, @rondluper could you guys take a look perhaps??

$ dart ./test/asymmetric/oaep_test.dart 
00:00 +0: Null/OAEP: encrypt: public: Lorem ipsum dolor sit amet[...]
00:00 +0 -1: Null/OAEP: encrypt: public: Lorem ipsum dolor sit amet[...] [E]
  Invalid argument(s): Input data too large
  package:pointycastle/asymmetric/oaep.dart 106:7                        OAEPEncoding._encodeBlock
  package:pointycastle/asymmetric/oaep.dart 97:14                        OAEPEncoding.processBlock
  package:pointycastle/src/impl/base_asymmetric_block_cipher.dart 15:15  BaseAsymmetricBlockCipher.process
  test/test/asymmetric_block_cipher_tests.dart 60:20                     _runCipherTest
  test/test/asymmetric_block_cipher_tests.dart 27:17                     runAsymmetricBlockCipherTests.<fn>.<fn>.<fn>
  package:test/src/backend/declarer.dart 168:27                          Declarer.test.<fn>.<fn>.<fn>
  ===== asynchronous gap ===========================
  dart:async/future_impl.dart 22:43                                      _Completer.completeError
  dart:async/runtime/libasync_patch.dart 40:18                           _AsyncAwaitCompleter.completeError
  package:test/src/backend/declarer.dart                                 Declarer.test.<fn>.<fn>.<fn>
  ===== asynchronous gap ===========================
  dart:async/zone.dart 1053:19                                           _CustomZone.registerUnaryCallback
  dart:async/runtime/libasync_patch.dart 77:23                           _asyncThenWrapperHelper
  package:test/src/backend/declarer.dart                                 Declarer.test.<fn>.<fn>.<fn>
  package:test/src/backend/invoker.dart 250:15                           Invoker.waitForOutstandingCallbacks.<fn>
  ===== asynchronous gap ===========================
  dart:async/zone.dart 1045:19                                           _CustomZone.registerCallback
  dart:async/zone.dart 962:22                                            _CustomZone.bindCallbackGuarded
  dart:async/timer.dart 52:45                                            new Timer
  dart:async/timer.dart 87:9                                             Timer.run
  dart:async/future.dart 174:11                                          new Future
  package:test/src/backend/invoker.dart 402:11                           Invoker._onRun.<fn>.<fn>.<fn>

00:00 +0 -1: Null/OAEP: encrypt: private: Lorem ipsum dolor sit amet[...]
00:00 +0 -2: Null/OAEP: encrypt: private: Lorem ipsum dolor sit amet[...] [E]
  Invalid argument(s): Input data too large
  package:pointycastle/asymmetric/oaep.dart 106:7                        OAEPEncoding._encodeBlock
  package:pointycastle/asymmetric/oaep.dart 97:14                        OAEPEncoding.processBlock
  package:pointycastle/src/impl/base_asymmetric_block_cipher.dart 15:15  BaseAsymmetricBlockCipher.process
  test/test/asymmetric_block_cipher_tests.dart 60:20                     _runCipherTest
  test/test/asymmetric_block_cipher_tests.dart 30:19                     runAsymmetricBlockCipherTests.<fn>.<fn>.<fn>
  package:test/src/backend/declarer.dart 168:27                          Declarer.test.<fn>.<fn>.<fn>
  ===== asynchronous gap ===========================
  dart:async/future_impl.dart 22:43                                      _Completer.completeError
  dart:async/runtime/libasync_patch.dart 40:18                           _AsyncAwaitCompleter.completeError
  package:test/src/backend/declarer.dart                                 Declarer.test.<fn>.<fn>.<fn>
  ===== asynchronous gap ===========================
  dart:async/zone.dart 1053:19                                           _CustomZone.registerUnaryCallback
  dart:async/runtime/libasync_patch.dart 77:23                           _asyncThenWrapperHelper
  package:test/src/backend/declarer.dart                                 Declarer.test.<fn>.<fn>.<fn>
  package:test/src/backend/invoker.dart 250:15                           Invoker.waitForOutstandingCallbacks.<fn>
  ===== asynchronous gap ===========================
  dart:async/zone.dart 1045:19                                           _CustomZone.registerCallback
  dart:async/zone.dart 962:22                                            _CustomZone.bindCallbackGuarded
  dart:async/timer.dart 52:45                                            new Timer
  dart:async/timer.dart 87:9                                             Timer.run
  dart:async/future.dart 174:11                                          new Future
  package:test/src/backend/invoker.dart 402:11                           Invoker._onRun.<fn>.<fn>.<fn>

00:00 +0 -2: Null/OAEP: encrypt: public: En un lugar de La Mancha, [...]
00:00 +0 -3: Null/OAEP: encrypt: public: En un lugar de La Mancha, [...] [E]
  Invalid argument(s): Input data too large
  package:pointycastle/asymmetric/oaep.dart 106:7                        OAEPEncoding._encodeBlock
  package:pointycastle/asymmetric/oaep.dart 97:14                        OAEPEncoding.processBlock
  package:pointycastle/src/impl/base_asymmetric_block_cipher.dart 15:15  BaseAsymmetricBlockCipher.process
  test/test/asymmetric_block_cipher_tests.dart 60:20                     _runCipherTest
  test/test/asymmetric_block_cipher_tests.dart 27:17                     runAsymmetricBlockCipherTests.<fn>.<fn>.<fn>
  package:test/src/backend/declarer.dart 168:27                          Declarer.test.<fn>.<fn>.<fn>
  ===== asynchronous gap ===========================
  dart:async/future_impl.dart 22:43                                      _Completer.completeError
  dart:async/runtime/libasync_patch.dart 40:18                           _AsyncAwaitCompleter.completeError
  package:test/src/backend/declarer.dart                                 Declarer.test.<fn>.<fn>.<fn>
  ===== asynchronous gap ===========================
  dart:async/zone.dart 1053:19                                           _CustomZone.registerUnaryCallback
  dart:async/runtime/libasync_patch.dart 77:23                           _asyncThenWrapperHelper
  package:test/src/backend/declarer.dart                                 Declarer.test.<fn>.<fn>.<fn>
  package:test/src/backend/invoker.dart 250:15                           Invoker.waitForOutstandingCallbacks.<fn>
  ===== asynchronous gap ===========================
  dart:async/zone.dart 1045:19                                           _CustomZone.registerCallback
  dart:async/zone.dart 962:22                                            _CustomZone.bindCallbackGuarded
  dart:async/timer.dart 52:45                                            new Timer
  dart:async/timer.dart 87:9                                             Timer.run
  dart:async/future.dart 174:11                                          new Future
  package:test/src/backend/invoker.dart 402:11                           Invoker._onRun.<fn>.<fn>.<fn>

00:00 +0 -3: Null/OAEP: encrypt: private: En un lugar de La Mancha, [...]
00:00 +0 -4: Null/OAEP: encrypt: private: En un lugar de La Mancha, [...] [E]
  Invalid argument(s): Input data too large
  package:pointycastle/asymmetric/oaep.dart 106:7                        OAEPEncoding._encodeBlock
  package:pointycastle/asymmetric/oaep.dart 97:14                        OAEPEncoding.processBlock
  package:pointycastle/src/impl/base_asymmetric_block_cipher.dart 15:15  BaseAsymmetricBlockCipher.process
  test/test/asymmetric_block_cipher_tests.dart 60:20                     _runCipherTest
  test/test/asymmetric_block_cipher_tests.dart 30:19                     runAsymmetricBlockCipherTests.<fn>.<fn>.<fn>
  package:test/src/backend/declarer.dart 168:27                          Declarer.test.<fn>.<fn>.<fn>
  ===== asynchronous gap ===========================
  dart:async/future_impl.dart 22:43                                      _Completer.completeError
  dart:async/runtime/libasync_patch.dart 40:18                           _AsyncAwaitCompleter.completeError
  package:test/src/backend/declarer.dart                                 Declarer.test.<fn>.<fn>.<fn>
  ===== asynchronous gap ===========================
  dart:async/zone.dart 1053:19                                           _CustomZone.registerUnaryCallback
  dart:async/runtime/libasync_patch.dart 77:23                           _asyncThenWrapperHelper
  package:test/src/backend/declarer.dart                                 Declarer.test.<fn>.<fn>.<fn>
  package:test/src/backend/invoker.dart 250:15                           Invoker.waitForOutstandingCallbacks.<fn>
  ===== asynchronous gap ===========================
  dart:async/zone.dart 1045:19                                           _CustomZone.registerCallback
  dart:async/zone.dart 962:22                                            _CustomZone.bindCallbackGuarded
  dart:async/timer.dart 52:45                                            new Timer
  dart:async/timer.dart 87:9                                             Timer.run
  dart:async/future.dart 174:11                                          new Future
  package:test/src/backend/invoker.dart 402:11                           Invoker._onRun.<fn>.<fn>.<fn>

00:00 +0 -4: Null/OAEP: decrypt: public: Lorem ipsum dolor sit amet[...]
00:00 +0 -5: Null/OAEP: decrypt: public: Lorem ipsum dolor sit amet[...] [E]
  Invalid argument(s): data wrong
  package:pointycastle/asymmetric/oaep.dart 222:7                        OAEPEncoding._decodeBlock
  package:pointycastle/asymmetric/oaep.dart 99:14                        OAEPEncoding.processBlock
  package:pointycastle/src/impl/base_asymmetric_block_cipher.dart 15:15  BaseAsymmetricBlockCipher.process
  test/test/asymmetric_block_cipher_tests.dart 72:20                     _runDecipherTest
  test/test/asymmetric_block_cipher_tests.dart 43:19                     runAsymmetricBlockCipherTests.<fn>.<fn>.<fn>
  package:test/src/backend/declarer.dart 168:27                          Declarer.test.<fn>.<fn>.<fn>
  ===== asynchronous gap ===========================
  dart:async/future_impl.dart 22:43                                      _Completer.completeError
  dart:async/runtime/libasync_patch.dart 40:18                           _AsyncAwaitCompleter.completeError
  package:test/src/backend/declarer.dart                                 Declarer.test.<fn>.<fn>.<fn>
  ===== asynchronous gap ===========================
  dart:async/zone.dart 1053:19                                           _CustomZone.registerUnaryCallback
  dart:async/runtime/libasync_patch.dart 77:23                           _asyncThenWrapperHelper
  package:test/src/backend/declarer.dart                                 Declarer.test.<fn>.<fn>.<fn>
  package:test/src/backend/invoker.dart 250:15                           Invoker.waitForOutstandingCallbacks.<fn>
  ===== asynchronous gap ===========================
  dart:async/zone.dart 1045:19                                           _CustomZone.registerCallback
  dart:async/zone.dart 962:22                                            _CustomZone.bindCallbackGuarded
  dart:async/timer.dart 52:45                                            new Timer
  dart:async/timer.dart 87:9                                             Timer.run
  dart:async/future.dart 174:11                                          new Future
  package:test/src/backend/invoker.dart 402:11                           Invoker._onRun.<fn>.<fn>.<fn>

00:00 +0 -5: Null/OAEP: decrypt: private: Lorem ipsum dolor sit amet[...]
00:00 +0 -6: Null/OAEP: decrypt: private: Lorem ipsum dolor sit amet[...] [E]
  Invalid argument(s): data wrong
  package:pointycastle/asymmetric/oaep.dart 222:7                        OAEPEncoding._decodeBlock
  package:pointycastle/asymmetric/oaep.dart 99:14                        OAEPEncoding.processBlock
  package:pointycastle/src/impl/base_asymmetric_block_cipher.dart 15:15  BaseAsymmetricBlockCipher.process
  test/test/asymmetric_block_cipher_tests.dart 72:20                     _runDecipherTest
  test/test/asymmetric_block_cipher_tests.dart 47:19                     runAsymmetricBlockCipherTests.<fn>.<fn>.<fn>
  package:test/src/backend/declarer.dart 168:27                          Declarer.test.<fn>.<fn>.<fn>
  ===== asynchronous gap ===========================
  dart:async/future_impl.dart 22:43                                      _Completer.completeError
  dart:async/runtime/libasync_patch.dart 40:18                           _AsyncAwaitCompleter.completeError
  package:test/src/backend/declarer.dart                                 Declarer.test.<fn>.<fn>.<fn>
  ===== asynchronous gap ===========================
  dart:async/zone.dart 1053:19                                           _CustomZone.registerUnaryCallback
  dart:async/runtime/libasync_patch.dart 77:23                           _asyncThenWrapperHelper
  package:test/src/backend/declarer.dart                                 Declarer.test.<fn>.<fn>.<fn>
  package:test/src/backend/invoker.dart 250:15                           Invoker.waitForOutstandingCallbacks.<fn>
  ===== asynchronous gap ===========================
  dart:async/zone.dart 1045:19                                           _CustomZone.registerCallback
  dart:async/zone.dart 962:22                                            _CustomZone.bindCallbackGuarded
  dart:async/timer.dart 52:45                                            new Timer
  dart:async/timer.dart 87:9                                             Timer.run
  dart:async/future.dart 174:11                                          new Future
  package:test/src/backend/invoker.dart 402:11                           Invoker._onRun.<fn>.<fn>.<fn>

00:00 +0 -6: Null/OAEP: decrypt: public: En un lugar de La Mancha, [...]
00:00 +0 -7: Null/OAEP: decrypt: public: En un lugar de La Mancha, [...] [E]
  Invalid argument(s): data wrong
  package:pointycastle/asymmetric/oaep.dart 222:7                        OAEPEncoding._decodeBlock
  package:pointycastle/asymmetric/oaep.dart 99:14                        OAEPEncoding.processBlock
  package:pointycastle/src/impl/base_asymmetric_block_cipher.dart 15:15  BaseAsymmetricBlockCipher.process
  test/test/asymmetric_block_cipher_tests.dart 72:20                     _runDecipherTest
  test/test/asymmetric_block_cipher_tests.dart 43:19                     runAsymmetricBlockCipherTests.<fn>.<fn>.<fn>
  package:test/src/backend/declarer.dart 168:27                          Declarer.test.<fn>.<fn>.<fn>
  ===== asynchronous gap ===========================
  dart:async/future_impl.dart 22:43                                      _Completer.completeError
  dart:async/runtime/libasync_patch.dart 40:18                           _AsyncAwaitCompleter.completeError
  package:test/src/backend/declarer.dart                                 Declarer.test.<fn>.<fn>.<fn>
  ===== asynchronous gap ===========================
  dart:async/zone.dart 1053:19                                           _CustomZone.registerUnaryCallback
  dart:async/runtime/libasync_patch.dart 77:23                           _asyncThenWrapperHelper
  package:test/src/backend/declarer.dart                                 Declarer.test.<fn>.<fn>.<fn>
  package:test/src/backend/invoker.dart 250:15                           Invoker.waitForOutstandingCallbacks.<fn>
  ===== asynchronous gap ===========================
  dart:async/zone.dart 1045:19                                           _CustomZone.registerCallback
  dart:async/zone.dart 962:22                                            _CustomZone.bindCallbackGuarded
  dart:async/timer.dart 52:45                                            new Timer
  dart:async/timer.dart 87:9                                             Timer.run
  dart:async/future.dart 174:11                                          new Future
  package:test/src/backend/invoker.dart 402:11                           Invoker._onRun.<fn>.<fn>.<fn>

00:00 +0 -7: Null/OAEP: decrypt: private: En un lugar de La Mancha, [...]
00:00 +0 -8: Null/OAEP: decrypt: private: En un lugar de La Mancha, [...] [E]
  Invalid argument(s): data wrong
  package:pointycastle/asymmetric/oaep.dart 222:7                        OAEPEncoding._decodeBlock
  package:pointycastle/asymmetric/oaep.dart 99:14                        OAEPEncoding.processBlock
  package:pointycastle/src/impl/base_asymmetric_block_cipher.dart 15:15  BaseAsymmetricBlockCipher.process
  test/test/asymmetric_block_cipher_tests.dart 72:20                     _runDecipherTest
  test/test/asymmetric_block_cipher_tests.dart 47:19                     runAsymmetricBlockCipherTests.<fn>.<fn>.<fn>
  package:test/src/backend/declarer.dart 168:27                          Declarer.test.<fn>.<fn>.<fn>
  ===== asynchronous gap ===========================
  dart:async/future_impl.dart 22:43                                      _Completer.completeError
  dart:async/runtime/libasync_patch.dart 40:18                           _AsyncAwaitCompleter.completeError
  package:test/src/backend/declarer.dart                                 Declarer.test.<fn>.<fn>.<fn>
  ===== asynchronous gap ===========================
  dart:async/zone.dart 1053:19                                           _CustomZone.registerUnaryCallback
  dart:async/runtime/libasync_patch.dart 77:23                           _asyncThenWrapperHelper
  package:test/src/backend/declarer.dart                                 Declarer.test.<fn>.<fn>.<fn>
  package:test/src/backend/invoker.dart 250:15                           Invoker.waitForOutstandingCallbacks.<fn>
  ===== asynchronous gap ===========================
  dart:async/zone.dart 1045:19                                           _CustomZone.registerCallback
  dart:async/zone.dart 962:22                                            _CustomZone.bindCallbackGuarded
  dart:async/timer.dart 52:45                                            new Timer
  dart:async/timer.dart 87:9                                             Timer.run
  dart:async/future.dart 174:11                                          new Future
  package:test/src/backend/invoker.dart 402:11                           Invoker._onRun.<fn>.<fn>.<fn>

00:00 +0 -8: Some tests failed.

Unhandled exception:
Dummy exception to set exit code.
#0      _rootHandleUncaughtError.<anonymous closure> (dart:async/zone.dart:1112:29)
#1      _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#2      _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#3      _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:391:30)
#4      _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)
#5      _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
duncanhoggan commented 5 years ago

@stevenroose I had issues with the dart environment (mailed you about it) and couldn't get the test suite running, hence the tests were never run. I'll have a look and see if i can get them sorted out some time.

stevenroose commented 5 years ago

Yeah I made a commit removing some old unused packages that also broke the compilation on my machine. So now I can run them again.

Must have missed your e-mail. Usually better to create issues, I have filters for that :p

On Fri, Feb 22, 2019, 14:14 Duncan Hoggan <notifications@github.com wrote:

@stevenroose https://github.com/stevenroose I had issues with the dart environment (mailed you about it) and couldn't get the test suite running, hence the tests were never run. I'll have a look and see if i can get them sorted out some time.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/PointyCastle/pointycastle/issues/173#issuecomment-466409879, or mute the thread https://github.com/notifications/unsubscribe-auth/AA0F3El6WO8VmyGWJWXC-4k6FjxbyunUks5vP_tcgaJpZM4bFlEO .

duncanhoggan commented 5 years ago

I've checked the test and it is structured correctly the length warning is also correct. I will adjust the test data accordingly, won't be difficult, just need the correct input parameters. Also you did reply on the mail, your rules are working fine 😁.