Commit graph

11 commits

Author SHA1 Message Date
Jason Rhinelander 6fcfd0b8ba
Update oxenmq to latest oxen-mq+oxen-encoding
All the encoding parts move to oxen-encoding recently; this updates to
the latest version of oxen-mq, adds oxen-encoding, and converts
everything to use oxenc headers rather than the oxenmq compatibility
shims.
2022-04-14 14:32:01 -03:00
Jason Rhinelander dfb3f29bfe Add warning if restoring an ed25519 key to a file name .../key
A couple people have messaged me now because they tried transferring
keys and used the `restore` command on their legacy `key` file, but it
restored an ed25519 key.

This adds a red warning if attempting to restore an ed key to a filename
ending in `/key` with a note about probably wanting the restore-legacy
command instead.
2021-04-20 00:27:48 -03:00
Jason Rhinelander 466a1317d2 Rename lokimq -> oxenmq 2021-01-14 19:35:00 -04:00
Sean Darcy 851f9af707 lokinet revert 2021-01-04 15:21:21 +11:00
Sean Darcy 432dc319a9 executable names changed 2021-01-04 14:19:42 +11:00
Sean Darcy 0396698ee7 initial loki -> oxen pass 2021-01-04 11:09:45 +11:00
Jason Rhinelander 6c50740375 Fix loki-sn-keys ed25519 key restoration
crypto_sign_seed_keypair() does not safely work when seed==sk, so read
and store the seed separately to fix it.
2020-11-27 13:26:36 -04:00
Jason Rhinelander b54f8ae845 Fix abort not actually aborting
If the input gets EOF it was printing "Aborted" but then going ahead
anyway.
2020-11-27 13:25:25 -04:00
Jason Rhinelander 1dd98f3dae std::filesystem
Converts all use of boost::filesystem to std::filesystem.

For macos and potentially other exotic systems where std::filesystem
isn't available, we use ghc::filesystem instead (which is a drop-in
replacement for std::filesystem, unlike boost::filesystem).

This also greatly changes how we handle filenames internally by holding
them in filesystem::path objects as soon as possible (using
fs::u8path()), rather than strings, which avoids a ton of issues around
unicode filenames.  As a result this lets us drop the boost::locale
dependency on Windows along with a bunch of messy Windows ifdef code,
and avoids the need for doing gross boost locale codecvt calls.
2020-10-24 12:45:37 -03:00
Jason Rhinelander 41b1b46cfe Add missing optional header 2020-09-03 11:06:24 -03:00
Jason Rhinelander 0bfafd15b6
Add loki-sn-keys SN key management tool (#1241)
This allows inspecting, generating, and restoring both Ed25519 and
legacy (naming in line with PR #1240 now avoiding the non-Ed25519 keys
by default) secret key files as needed by lokid:

    $ ./loki-sn-keys generate key_ed25519
    Generated SN Ed25519 secret key in key_ed25519
    Public key:      8f94f6bbc1d5876484309fc7fd41396c6bd66c4631a34f04895887547cb374dd
    X25519 pubkey:   f3e42d1aff8db8232433ec86e3f56cdda44d4c510144f9b6786520175b08c97f
    Lokinet address: t6kxpq6b4sdsjbbou9d94oj3pti7c5ngggtw6brjmndie9fuquqo.snode

    $ ./loki-sn-keys legacy key
    Generated SN legacy private key in key
    Public key: f3a513ddfbe946c79c62c27cca2260b80606a2da1b4f75ba16c793a5750a8510

    $ ./loki-sn-keys show key
    key (legacy SN keypair)
    ==========
    Private key: c8c17cc296c3e8bb603098b5d2535ad86662cdb24cd4c785c0485d0a490a2356
    Public key:  f3a513ddfbe946c79c62c27cca2260b80606a2da1b4f75ba16c793a5750a8510

    $ ./loki-sn-keys show key_ed25519
    key_ed25519 (Ed25519 SN keypair)
    ==========
    Secret key:      3f078900bac5f3e97d5fe451a6e332826d29aae2e13fec895c1b527af88093c3
    Public key:      8f94f6bbc1d5876484309fc7fd41396c6bd66c4631a34f04895887547cb374dd
    X25519 pubkey:   f3e42d1aff8db8232433ec86e3f56cdda44d4c510144f9b6786520175b08c97f
    Lokinet address: t6kxpq6b4sdsjbbou9d94oj3pti7c5ngggtw6brjmndie9fuquqo.snode

    $ ./loki-sn-keys restore key_ed25519-2
    Enter the Ed25519 secret key:
    3f078900bac5f3e97d5fe451a6e332826d29aae2e13fec895c1b527af88093c3

    Public key:      8f94f6bbc1d5876484309fc7fd41396c6bd66c4631a34f04895887547cb374dd
    X25519 pubkey:   f3e42d1aff8db8232433ec86e3f56cdda44d4c510144f9b6786520175b08c97f
    Lokinet address: t6kxpq6b4sdsjbbou9d94oj3pti7c5ngggtw6brjmndie9fuquqo.snode

    Is this correct?  Press Enter to continue, Ctrl-C to cancel.

    Saved secret key to key_ed25519-2

    $ ./loki-sn-keys restore-legacy key-2
    Enter the legacy SN private key:
    c8c17cc296c3e8bb603098b5d2535ad86662cdb24cd4c785c0485d0a490a2356

    Public key:      f3a513ddfbe946c79c62c27cca2260b80606a2da1b4f75ba16c793a5750a8510

    Is this correct?  Press Enter to continue, Ctrl-C to cancel.

    Saved secret key to key-2
2020-09-01 16:21:25 +10:00