Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit b513692

Browse files
author
Jay Logue
authored
Merge pull request #389 from openweave/issue/fix-convert-prov-double-encode
Fix for Issue#388 : weave convert-provisioning-data command double encodes output
2 parents f83b6ce + 49252cd commit b513692

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/tools/weave/Cmd_ConvertProvisioningData.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,13 @@ bool ConvertPrivateKey(const char * inKeyB64, size_t inKeyB64Len, KeyFormat keyF
629629
ExitNow(res = false);
630630
}
631631

632+
// When Weave key format is requested, have EncodePrivateKey() encode to raw bytes, rather
633+
// than base64, since base64 encoding is handled below.
634+
if (keyFormat == kKeyFormat_Weave_Base64)
635+
{
636+
keyFormat = kKeyFormat_Weave_Raw;
637+
}
638+
632639
if (!EncodePrivateKey(inKeyDecoded, keyFormat, outKey, outKeyLen))
633640
{
634641
ExitNow(res = false);

0 commit comments

Comments
 (0)