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

Provided client public key has an incorrect modulus length. Modulus length must be "2048", got "1024" #92

Closed
1 of 2 tasks
M0rph3v5 opened this issue Apr 11, 2018 · 10 comments
Labels

Comments

@M0rph3v5
Copy link

M0rph3v5 commented Apr 11, 2018

Steps to reproduce:

  1. Create an Azure Function which runs the following code:

BunqContext.LoadApiContext(ApiContext.Create(ApiEnvironmentType.SANDBOX, "key", "description"));

What should happen:

  1. Assume no error and a succesfull session start

What happens:

  1. Errors! -> Provided client public key has an incorrect modulus length. Modulus length must be "2048", got "1024"

Traceback

SDK version and environment

  • Tested on latest code with the netstandard support
  • Sandbox
  • Production

Response id

  • Response id: 21d9ad87-f23b-406e-a5e7-5c7e92167fd6

Extra info:

runs on netstandard,

@OGKevin
Copy link
Contributor

OGKevin commented Apr 12, 2018

Thanks for reporting @M0rph3v5

As you've provided a response id I take it that this error came in back from the API and that no exception was thrown in the SDK itself as an actually SDK error ?

@michielpost do you mind looking into this one ?

@M0rph3v5
Copy link
Author

M0rph3v5 commented Apr 12, 2018

@OGKevin that's correct, searching provides me with: #26 (comment)

Having that same issue, but on .net 4.6 referring to https://github.com/dotnet/corefx/issues/12388

Not sure if that's related at all though, the SecurityUtils seems to handle the RSA key size the correct way.

@M0rph3v5
Copy link
Author

I can post the full response if that's useful when I get home.

@OGKevin
Copy link
Contributor

OGKevin commented Apr 12, 2018

@M0rph3v5 no need for full response, thats what the response id is for :P.

Ill take a look at this and see whats up. C# is not one of my strongest skills however so any help is appreciated.

@M0rph3v5
Copy link
Author

M0rph3v5 commented Apr 14, 2018

@OGKevin hah makes sense :P, it isn't my strong suit either. I just want to build stuff with it, not run in these vague problems 😅

any luck yet?

@BasvdM
Copy link

BasvdM commented May 2, 2018

If you change the method

public static RSA GenerateKeyPair() {
    var rsa = RSA.Create();
    rsa.KeySize = RSA_KEY_SIZE;
    return rsa;
}

to

public static RSA GenerateKeyPair() {
    var csp = new RSACryptoServiceProvider(RSA_KEY_SIZE);
    var rsa = (RSA)csp;
    return rsa;
}

i think it will work.

Maybe this will help to update the SDK.

@OGKevin
Copy link
Contributor

OGKevin commented May 2, 2018

@BasvdM thanks for this!

Do you mind creating a pull request ?

@BasvdM
Copy link

BasvdM commented May 2, 2018

@OGKevin I won't mind at all, but I'm all new to Github. What do you mean with pull request and what do I have to do exactly?

Sorry for my ignorance...

@OGKevin
Copy link
Contributor

OGKevin commented May 3, 2018

@BasvdM i think this explains it well enough: https://akrabat.com/the-beginners-guide-to-contributing-to-a-github-project/

Also make sure when you make a commit the following is in the commit msg: bunq/sdk_csharp#92.

Let me know if you manage if not ill do it my self 😉

@sanderlanghorstredhotminute

Running sdk_csharp 1.0.0 with a .net 4.7 application generates the same errors, still. When is this being fixed?

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

Successfully merging a pull request may close this issue.

4 participants