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

CKR_BUFFER_TOO_SMALL #82

Open
JoeKolba opened this issue Aug 30, 2017 · 1 comment
Open

CKR_BUFFER_TOO_SMALL #82

JoeKolba opened this issue Aug 30, 2017 · 1 comment

Comments

@JoeKolba
Copy link

This might not be an issue, but I keep running into this problem. I am using graphene with Vormetric Data Security Manager. I am able to connect to the pkcs11 agent, create an encryption key and encrypt data. However every time I try to decrypt I get the following:

CKR_BUFFER_TOO_SMALL

graphene-pk11/build/crypto/decipher.js:25:32

  Decipher.prototype.update = function (data) {
        try {
            var len = Math.ceil(data.length / this.blockSize) * this.blockSize;
            var dec = new Buffer(len);
            var res = this.lib.C_DecryptUpdate(this.session.handle, data, dec);
            return res;
        }
        catch (e) {
            try {
                this.final();
            }
            catch (e) { }
            throw e;
        }
    };

I believe this was a problem in the past that was already solved. I think it had to do with the calculation of the length. If anyone could help I would appreciate it.

@microshine
Copy link
Contributor

microshine commented Aug 30, 2017

Could you make a log for incoming data and get data.length, this.blockSize and mechanism you use, if it's possible

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