Skip to content

Problematic with unhandled thrown error ... #101

@ChrisGitIt

Description

@ChrisGitIt

data = options.decoder(helpers.decrypt(options, data, sessionId));

Hi all,

i just had a look at this lib in order to understand session handling.

I'm not fluently understanding the code, but it looks like there is an unhandled thrown error which might bring down apps that are using this lib.

Here is the function that is supposed to handle a decrypt:

data = options.decoder(helpers.decrypt(options, data, sessionId));

And this is the function call itself that throws an error that seems to be unhandled.

decrypt: function (options, data, sessionId) {
    var plaintext = null;

    options.kruptein.get(options.secret, data, function(err, pt) {
      if (err)
        throw err;

      plaintext = pt;
    });
    
    return plaintext;
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions