ssbc / ssb-keys

keyfile operations for ssb
36 stars 26 forks source link

When persisting, `key` is encoded with base64 twice #47

Closed the-kenny closed 4 years ago

the-kenny commented 5 years ago

keysToJSON calls tag(key.toString('base64'), curve) and tag calls key.toString(base64) again. This isn't a big issue in itself but might be confusing at some later point when the code gets refactored.

https://github.com/ssbc/ssb-keys/blob/master/util.js#L29

the-kenny commented 5 years ago

Correction: It isn't encoded twice, as toString on String is just a no-op. It's still unclear and clearly not intended :-)

stale[bot] commented 5 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

davegomez commented 4 years ago

@christianbundy I don't think this is a bug because there is no double encoding happening here.

I think the confusion comes from a function call tag that besides doing its job, to tag the input, it's also encoding it, which a different function should do.

the-kenny commented 4 years ago

Yup, was a misunderstanding on my side :-)