Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

PKCS #11 GNU Complexity Refactor #1996

Merged
merged 4 commits into from
May 12, 2020
Merged

Conversation

lundinc2
Copy link
Contributor

@lundinc2 lundinc2 commented May 11, 2020

PKCS #11 GNU Complexity Refactoring

Description

Functions that were bloated and need to be refactored to lower their GNU complexity due to switch statements being nested in loops, as well as having a lot of branches in the switch statement are refactored into multiple smaller functions in this PR.
Code is also reused between public and private EC keys to move towards the DRY principle.

  • Functions refactored to be at an acceptable GNU complexity level:
    • prvCreateCertificate
    • prvCreatePublicEcKey
    • prvCreatePrivateEcKey
    • prvCreatePrivateKey
    • prvCreateRsaPrivateKey

Checklist:

  • I have tested my changes. No regression in existing tests.
  • My code is Linted.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

lundinc2 added 2 commits May 11, 2020 15:57
    * Functions refactored to be at an acceptable GNU complexity level:
            * prvCreateCertificate
            * prvCreatePublicEcKey
            * prvCreatePrivateEcKey
            * prvCreatePrivateKey
            * prvCreateRsaPrivateKey
@lundinc2 lundinc2 requested a review from alfred2g May 11, 2020 23:24
alfred2g
alfred2g previously approved these changes May 12, 2020
@lundinc2 lundinc2 changed the title PKCS #11 Refactor PKCS #11 GNU Complexity Refactor May 12, 2020
@lundinc2 lundinc2 merged commit 26b235f into aws:master May 12, 2020
alfred2g pushed a commit to alfred2g/amazon-freertos that referenced this pull request May 21, 2020
* PKCS aws#11 Refactor
    * Functions refactored to be at an acceptable GNU complexity level:
            * prvCreateCertificate
            * prvCreatePublicEcKey
            * prvCreatePrivateEcKey
            * prvCreatePrivateKey
            * prvCreateRsaPrivateKey
shubhamkulkarni97 pushed a commit to shubhamkulkarni97/amazon-freertos that referenced this pull request Jul 7, 2020
* PKCS aws#11 Refactor
    * Functions refactored to be at an acceptable GNU complexity level:
            * prvCreateCertificate
            * prvCreatePublicEcKey
            * prvCreatePrivateEcKey
            * prvCreatePrivateKey
            * prvCreateRsaPrivateKey
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants