Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined klass argument to pbkdf2 does not throw or fail #44

Open
daviddahl opened this issue Jan 10, 2015 · 1 comment
Open

Undefined klass argument to pbkdf2 does not throw or fail #44

daviddahl opened this issue Jan 10, 2015 · 1 comment

Comments

@daviddahl
Copy link

Perhaps I am "doing it wrong" (it happens a lot), but the pbkdf2 function returns a 16 byte zeroed out key if an undefined klass is passed in as an argument:

var args = {
      key: pass,
      salt: salt,
      c: 1000,
      dkLen: 128,
      klass: undefined // XXX: using triplesec.HMAC_SHA256 of course works!
    };

    triplesec.pbkdf2(args, function callback (key) {
      console.log('PBKDF2 callback key: ',  key); // this key is basically [0,0,0,0,0,0,0...]
    });

btw: I would be happy to produce some clear usage examples if you have a place for them.

@SparkDustJoe
Copy link

Looking at the Iced Coffee source for the PBKDF2 function (triplesec/src/pbkdf2.iced
), there should be checks near line 73 and/or 106 to prevent that, where "if (klass==undefined) klass = HMAC-512," or something to that effect. I'm not familiar enough with the language nomenclature to suggest the exact fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants