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

Fixed RSA key bits wrong calculation for certain x509 certificate #313

Merged
merged 1 commit into from Oct 18, 2017

Conversation

Projects
None yet
3 participants
@zulzardi
Member

zulzardi commented Mar 10, 2017

I try to import few Trusted CA certificates and some of it gave error. After i'm go through the code and found wrong calculation RSA bits in file Mayaqua/encrypt.c in function X *X509ToX(X509 *x509). This patch I'm already make little changes to solved it. Below sample Trusted certificate have result error for u to test. This certificate own by one of the trusted CA in our country. Hope the patch can help other people have same issue with me.

-----BEGIN CERTIFICATE-----
MIIFWDCCBECgAwIBAgIBBDANBgkqhkiG9w0BAQsFADB/MQswCQYDVQQGEwJteTEL
MAkGA1UECgwCVE0xNDAyBgNVBAsMK1RNIEFwcGxpZWQgQnVzaW5lc3MgQ2VydGlm
aWNhdGlvbiBBdXRob3JpdHkxLTArBgNVBAMMJFRNIEFwcGxpZWQgQnVzaW5lc3Mg
Um9vdCBDZXJ0aWZpY2F0ZTAeFw0xMTEwMTAwODEzMjdaFw0zMDEwMTAwODQzMjda
MF8xCzAJBgNVBAYTAm15MQswCQYDVQQKDAJUTTENMAsGA1UECwwEVE1DQTE0MDIG
A1UEAwwrVE0gQXBwbGllZCBCdXNpbmVzcyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0
eTCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBAJKH3uHUl7yCjQArG6bg
EzA02td0bf304ZRWu0QMfgID6EeHCItvryJzZwUcqj5CW9LlGW2XeuEv/GNGXfAn
8CNQm7kGksUJj91PgfIA7L9pi6MhaWjvtexkcB/5/0b8G0TF6h7RdBZd1jOrcXKB
+L918GXUwTABQMxzK2Qtsbq+w5l2BsHvmO2BhEtegyGmRK67FFMbIJx+G7ES9F7w
Ez7rFsSnsjvrzWZUKZOpeFkvIakjb92zcg5LqrUPSP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
+qByj/yNRc/o0y0O72fuv2sXhTuQ+B53d51O6tyGC6bySEZTqa7l1VAHdTh6QFM/
HJLlNa8VYDQ+hVNECSoU2lJf662qH0DPMvjeYA==
-----END CERTIFICATE-----

Update Encrypt.c
Fixed RSA bits wrong calculation for certain x509 certificate

@zulzardi zulzardi changed the title from Update Encrypt.c to Fixed RSA bits wrong calculation for certain x509 certificate Mar 10, 2017

@zulzardi zulzardi changed the title from Fixed RSA bits wrong calculation for certain x509 certificate to Fixed RSA key bits wrong calculation for certain x509 certificate Mar 15, 2017

@zulzardi

This comment has been minimized.

Show comment
Hide comment
@zulzardi

zulzardi Mar 27, 2017

Member

I choose option 1

Member

zulzardi commented Mar 27, 2017

I choose option 1

@inetbiz

This comment has been minimized.

Show comment
Hide comment
@inetbiz

inetbiz commented May 13, 2017

@dnobori

This comment has been minimized.

Show comment
Hide comment
@dnobori

dnobori Oct 18, 2017

Member

Thank you so much for your contribution to enrich the SoftEther VPN source code.

Your patch has been merged on the main source-tree of SoftEther VPN.

As a token of our gratitude, your GitHub username will be added on the AUTHORS.TXT file and on the header of the related source file.
(It will be done within a few days.)
https://github.com/SoftEtherVPN/SoftEtherVPN/blob/master/AUTHORS.TXT

Thanks again for your contribution.

Member

dnobori commented Oct 18, 2017

Thank you so much for your contribution to enrich the SoftEther VPN source code.

Your patch has been merged on the main source-tree of SoftEther VPN.

As a token of our gratitude, your GitHub username will be added on the AUTHORS.TXT file and on the header of the related source file.
(It will be done within a few days.)
https://github.com/SoftEtherVPN/SoftEtherVPN/blob/master/AUTHORS.TXT

Thanks again for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment