Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

[CO-389] Patch x509 parseSAN function to encode IP to valid bytes #3658

Merged
merged 1 commit into from
Sep 25, 2018

Conversation

KtorZ
Copy link
Contributor

@KtorZ KtorZ commented Sep 24, 2018

Description

Turns out that we can't use the 'encode' function from Net.IP as it generates
invalid encoding for x509. I left a NOTE explaining what's going on such that
next readers will know what's going on.

Linked issue

CO-389

Type of change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • 🛠 New feature (non-breaking change which adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
  • 🏭 Refactoring that does not change existing functionality but does improve things like code readability, structure etc
  • 🔨 New or improved tests for existing code
  • ⛑ git-flow chore (backport, hotfix, etc)

Developer checklist

  • I have read the style guide document, and my code follows the code style of this project.
  • If my code deals with exceptions, it follows the guidelines.
  • I have updated any documentation accordingly, if needed. Documentation changes can be reflected in opening a PR on cardanodocs.com, amending the inline Haddock comments, any relevant README file or one of the document listed in the docs directory.
  • [ ] CHANGELOG entry has been added and is linked to the correct PR on GitHub.

Testing checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.

QA Steps

Screenshots (if available)

@@ -282,7 +308,7 @@ validateCertificateIP ip cert =
toCommonName =
asn1CharacterToString >=> (ipFromBytes . B8.pack)
in
if any (== ip) (maybeToList commonName ++ altNames) then
if ip `elem` (maybeToList commonName ++ altNames) then
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hlint was complaining.

@KtorZ KtorZ force-pushed the KtorZ/CO-389/patch-x509-parse-san branch from d17c915 to b55b1cb Compare September 24, 2018 15:18
Turns out that we can't use the 'encode' function from Net.IP as it generates
invalid encoding for x509. I left a NOTE explaining what's going on such that
next readers will know what's going on.
@KtorZ KtorZ force-pushed the KtorZ/CO-389/patch-x509-parse-san branch from b55b1cb to 2671d6b Compare September 24, 2018 16:39
@KtorZ
Copy link
Contributor Author

KtorZ commented Sep 25, 2018

Merging with integration tests still failing (unrelated), but at least, we can now query the /api/v1/node-info back again.

  1) Accounts can retrieve initial and updated balances of several accounts from getAccountBalancesthat are equivalent to what is obtained from getAccounts
       uncaught exception: PatternMatchFail
  2) Accounts redeeming avvm key gives rise to the corresponding increase of balance of wallet'account - mnemonic not used
       Falsifiable (after 1 test):
  3) Transactions posted transactions appear in the index
       Falsifiable (after 1 test):
  4) Transactions asset-locked wallets can receive funds and transactions are confirmed in index
       Falsifiable (after 1 test):
  5) Transactions sending from asset-locked address in wallet with no ther addresses gets 0 confirmations from core nodes
       uncaught exception: PatternMatchFail

@KtorZ KtorZ merged commit 0544405 into develop Sep 25, 2018
@KtorZ KtorZ deleted the KtorZ/CO-389/patch-x509-parse-san branch September 25, 2018 06:28
@rvl rvl mentioned this pull request Sep 25, 2018
12 tasks
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.

2 participants