sjudson / paseto.js

PASETO: Platform-Agnostic Security Tokens
MIT License
269 stars 16 forks source link

use wrappers instead of wrapper-sumo #23

Closed PCouaillier closed 4 years ago

PCouaillier commented 5 years ago

Hello.

Is there any reason that I don't know about the fact that you use wrapper-sumo instead of the lighter wrapper lib ?

sjudson commented 5 years ago

Hmm... as I recall there was an API call I needed that wasn't available in the smaller interface, but tests seem to be passing. I'll try and track down what it was I thought it was needed for, and if I can't find it I'll merge this. Thanks.

sloonz commented 4 years ago

It’s needed for PrivateKey.public() for V2 protocol. Can we revert this please ?

sloonz commented 4 years ago

Failing test :

    it('should extract public key from private key', (done) => {    
      V2.private((err, pk) => {    
        if (err) { return done(err); }    

        pk.public((err, pub) => {    
          if (err) { return done(err); }    

          assert.ok(pub instanceof Paseto.PublicKey);    

          done();    
        });    
      });    
    });    

Error: UnhandledPromiseRejectionWarning: TypeError: sodium.crypto_sign_ed25519_sk_to_pk is not a function

The function is in sumo wrappers : https://github.com/jedisct1/libsodium.js/issues/92

PCouaillier commented 4 years ago

@sjudson

sjudson commented 4 years ago

@PCouaillier @sloonz Yeah. I just noticed this fixing #28. I knew it was used somewhere. Have reverted locally, will have a new release up with it restored (and that issue fixed) tomorrow.

sjudson commented 4 years ago

Reverted in https://github.com/sjudson/paseto.js/commit/a716aaeffbd5ee62e7dbf664393a1318d401d370 which is part of 0.1.6.