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

Commit 49252cd

Browse files
author
Jay Logue
committed
Fix for Issue#388 : weave convert-provisioning-data command double encodes output
1 parent f83b6ce commit 49252cd

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)