Review main Merged

10485[BUGFIX] Only create one keypair in rsaauth

Marco Huber CR +2 V +2 Hard +499 −47 updated 01/09/14, 00:43

Commit message

If there are two login forms on one page the second form's private
key overwrites the first form's private key so the first form doesn't
work. With this patch only one keypair gets created and it doesn't
matter how many login forms you have one one page.

Review

  • Code review CR +2
    • Markus Klein +2
    • Stefan Neufeind +1
    • Daniel Gorges +1
    • Benni Mack +1
  • Verified V +2
    • Markus Klein +2
    • Daniel Gorges +1
    • Benni Mack +1

Files 8

Review log 51

Show 26 earlier messages
  1. Dmitry Dulepov commented on patch set 1 05/27/13, 17:19

    Fails; I would prefer that you didn't submit this There are major changes in the behavior and API. It is now incompatible with existing. Please, make sure that your change is fully compatibile with previous versions. Rsaauth is a public sysext, it can be used from anywhere, not just from the core. Your change can break any external ext.

    class.tx_rsaauth_feloginhook.php:68

    Use the existing function.

    class.tx_rsaauth_loginformhook.php:53

    Use the existing function.

    class.tx_rsaauth_usersetuphook.php:94

    Use the existing function.

    class.tx_rsaauth_abstract_backend.php:61

    Keep the declared API as is. There is no need for the new function here. Just describe the behavior change.

    class.tx_rsaauth_cmdline_backend.php:78

    Use the existing function.

    class.tx_rsaauth_keypair.php:41

    If you remove this value, you have to make a constructor, which sets it. Otherwise the current behavior will be broken. So far neither of "set" methods were mandatory. With you change they become mandatory without any prior notice. This is a no go.

    class.tx_rsaauth_keypair.php:48

    Same as above.

    class.tx_rsaauth_keypair.php:55

    Same as above.

    class.tx_rsaauth_php_backend.php:43

    Use the existing function.
  2. Marco Huber uploaded patch set 2 05/27/13, 17:19

    class.tx_rsaauth_keypair.php:63

    I'm unsure if this one works.
  3. Dmitry Dulepov commented on patch set 3 5 comments 05/27/13, 17:19

    I would prefer that you didn't submit this Thanks for reworking! I have some more comments.
  4. Oliver Klee commented on patch set 3 05/27/13, 17:19

    (4 inline comments)
  5. Marco Huber uploaded patch set 3 05/27/13, 17:19

  6. Marco Huber commented on patch set 3 05/27/13, 17:19

    (1 inline comment) Thank you for your comments Dmitry, I reworked the patch.
  7. Oliver Klee commented on patch set 4 05/27/13, 17:19

    I'll rework the patch to use gaurd clauses where it makes sense.
  8. Oliver Klee uploaded patch set 5 05/27/13, 17:19

  9. Dmitry Dulepov commented on patch set 6 05/27/13, 17:19

    Looks like hard-to-create unit tests hold the nice patch for too long... Shouldn't we be more pragmatic and submit this without unit tests?
  10. Stefan Neufeind commented on patch set 6 05/27/13, 17:19

    @Oliver: Since you seem to have an idea for the needed tests and they seem to mean a lot to you, could you maybe go for an initial version of tests? (This is not meant as an offense. I just have the feeling we're getting nowhere because of the current deadlock.)
  11. Stefan Neufeind commented on patch set 6 05/27/13, 17:19

    @Oliver: I expect it's not too easy to write an automated testcase for this. Do you maybe have some idea how to "mock" that test? Should be easy to test by hand but ...
  12. Stefan Neufeind commented on patch set 6 05/27/13, 17:19

    please pick this one up again
  13. Oliver Klee commented on patch set 6 05/27/13, 17:19

    I've changed the functions to guard clauses, cleaned up some things, changed the exceptions to BadMethodCallExceptions and fixed a few spelling mistakes. However, I have no idea how to test this. I'm also not too happy with the current function naming (as the old names don't fit the new behavior). The checks with the exceptions also could be improved. Currently, the message is about calling the set* functions to times, but the check is about isReady.
  14. Oliver Klee commented on patch set 6 05/27/13, 17:19

    The unit tests won't be that hard to create - someone just needs to invest the time to do so.
  15. Oliver Klee commented on patch set 6 05/27/13, 17:19

    Having some unit tests (that test the expected behavior) would be great. For writing them, knowing the expected behavior would be helpful, of course ... :-)
  16. Oliver Klee commented on patch set 6 05/27/13, 17:19

    I'll try to find some time for the tests this week.
  17. Oliver Klee uploaded patch set 6 05/27/13, 17:19

  18. Oliver Klee commented on patch set 6 05/27/13, 17:19

    I would prefer that you didn't submit this
  19. Oliver Klee commented on patch set 6 05/27/13, 17:19

    As far as I can see, the classes except for the hook do not rely on much of an environment, i.e., we could just test for the returned (or changed) data. Concerning the hook: We probably need to have a mock FE (either by createMock('tslib_fe') or with testingFramework->createFakeFrontEnd()) when calling the hook. In addition, StorageFactory::getStorage indirectly calls GeneralUtility::makeInstance. We can provide makeInstance with mocked instance via ::addInstance (for non-singletons). It is important to call GeneralUtility::purgeInstances() in tearDown to get rid of any stored instances so we leave a "clean public lavatory" after the tests have run. I hope this was helpful ...
  20. Oliver Klee commented on patch set 6 05/27/13, 17:19

    I'm currently working on it; hold on.
  21. Marco Huber uploaded patch set 4 05/27/13, 17:19

  22. Marco Huber commented on patch set 4 05/27/13, 17:19

    Now createNewKeyPair in the backends only returns something different from NULL if we have a keyPair.
  23. Marco Huber commented on patch set 4 05/27/13, 17:19

    And I fixed the CGL things, of cource ;-) Hopefully I didn't forget one...
  24. Mr. Jenkins commented on patch set 2 05/27/13, 17:19

    Fails; I would prefer that you didn't submit this Build Failed https://ci.typo3.org/job/typo3-v4-core-gerrit/4201/ : FAILURE
  25. Mr. Jenkins commented on patch set 3 05/27/13, 17:19

  26. Mr. Jenkins commented on patch set 4 05/27/13, 17:19

  1. Mr. Jenkins commented on patch set 6 05/27/13, 17:19

  2. Stefan Neufeind commented on patch set 6 11/14/13, 17:43

    @Oliver: short update please
  3. Stefan Neufeind commented on patch set 6 1 comment 11/14/13, 17:43

  4. Oliver Klee commented on patch set 6 11/14/13, 22:20

    I'll do the patch for the Security sprint at the last November weekend.

    class.tx_rsaauth_cmdline_backend.php:81

    CGL: MIssing space after the "if". I'd prefer this to be a guard clause.

    class.tx_rsaauth_keypair.php:63 Reply

    You don't need strlen here. You can just do !== '' && !== ''.

    class.tx_rsaauth_keypair.php:82

    CGL: MIssing space after the "if". Please switch the if/else to a guard clause. Ditto for the other functions. (Maybe you can also move the isReady check and the throwing into a separate function to avoid the duplication.)

    class.tx_rsaauth_php_backend.php:46

    Ditto.
  5. Michael Staatz voted on patch set 6 CR +1 11/22/13, 09:15

  6. Michael Staatz voted on patch set 6 V +1 11/22/13, 09:18

  7. Tom voted on patch set 6 V +1 CR +1 11/22/13, 09:22

  8. Tom uploaded patch set 7 11/22/13, 10:54

  9. Michael Staatz voted on patch set 7 V +1 CR +1 11/22/13, 10:57

  10. Markus Klein commented on patch set 7 CR -1 11/22/13, 11:00

    Let wait for Oli to finish this patch at the security sprint in a few days.
  11. Mr. Jenkins commented on patch set 7 11/22/13, 11:09

  12. Oliver Klee uploaded patch set 8 11/29/13, 15:37

  13. Mr. Jenkins commented on patch set 8 11/29/13, 15:50

  14. Markus Klein commented on patch set 8 4 comments 11/29/13, 16:16

    Please see comments. I'm not sure about CGL here, but do we usually start with uppercase letters for parameter descriptions?
  15. Oliver Klee commented on patch set 8 11/29/13, 16:25

    The CGL do not say anything about the first letter of parameter descriptions: http://docs.typo3.org/typo3cms/CodingGuidelinesReference/PhpFileFormatting/UsingPhpdoc/Index.html I personally prefer lowercase there as these are not full sentences, i.e., they start lowercase and do not have a full stop.
  16. Oliver Klee uploaded patch set 9 11/29/13, 16:32

  17. Mr. Jenkins commented on patch set 9 11/29/13, 16:48

  18. Markus Klein commented on patch set 9 1 comment 11/29/13, 16:56

    I'll repush
  19. Markus Klein voted on patch set 9 CR +1 11/29/13, 16:57

  20. Markus Klein commented on patch set 9 1 comment 11/29/13, 17:00

  21. Stefan Neufeind commented on patch set 9 CR +1 11/29/13, 17:12

    meanwhile: 6.2, 6.1, 6.0, 4.5
  22. Benni Mack commented on patch set 9 V +1 CR +1 12/09/13, 16:59

    Works like a charm!
  23. Daniel Gorges commented on patch set 9 V +1 CR +1 12/09/13, 17:06

    Check! Works!
  24. Markus Klein commented on patch set 9 V +2 CR +2 01/09/14, 00:43

    Keypair.php:98

    Superfluous (). Please increase readability.

    Keypair.php:135

    Superfluous (). Please increase readability.

    Keypair.php:152

    Isn't this usually uppercase? The...

    Keypair.php:152

    ups a space is missing now.

    Keypair.php:152 Reply

    forget it... my mistake in the diff view

    Keypair.php:172

    Superfluous (). Please increase readability.
  25. Markus Klein merged patch set 10 01/09/14, 00:43