Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: render the platform private/public key (base64) correctly #1154

Merged
merged 2 commits into from
Jul 18, 2023

Conversation

HashEngineering
Copy link
Collaborator

  • The last byte was always set to zero (0x00)

Issue being fixed or feature implemented

Fix the HPMN Operator private / public keypair rendering in base64 format.

Related PR's and Dependencies

Screenshots / Videos

How Has This Been Tested?

  • QA (Mobile Team)

Checklist:

  • I have performed a self-review of my own code and added comments where necessary
  • I have added or updated relevant unit/integration/functional/e2e tests

@HashEngineering HashEngineering self-assigned this Jul 9, 2023
@@ -309,7 +309,7 @@ class MasternodeKeysViewModel @Inject constructor(
val bytes = ByteArray(64)
decryptedKey.privKeyBytes.copyInto(bytes, 0, 0, 32)
// public key bytes have a 0x00 prefix byte that is ignored
decryptedKey.pubKey.copyInto(bytes, 32, 1, 32)
decryptedKey.pubKey.copyInto(bytes, 32, 1, 33)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

pubKey is 33 bytes. In this format, we need the last 32 bytes copied. The parameters for copyInto are indexes, rather than lengths.

Copy link
Member

@Syn-McJ Syn-McJ left a comment

Choose a reason for hiding this comment

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

Looks good

@HashEngineering HashEngineering merged commit 22626ed into master Jul 18, 2023
1 check passed
@HashEngineering HashEngineering deleted the bugfix-hpmn-keys branch September 26, 2023 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants