FAQ
Reviewers: golang-dev_googlegroups.com,

Message:
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com),

I'd like you to review this change to
https://code.google.com/p/go/


Description:
crypto/x509: test for negative RSA parameters.

Someone found software that generates negative numbers for the RSA
modulus in an X.509 certificate. Our error messages were very poor in
this case so this change improves that.

Update issue 4728
Return more helpful errors when RSA parameters are negative or zero.

Please review this at https://codereview.appspot.com/7228072/

Affected files:
M src/pkg/crypto/x509/x509.go


Index: src/pkg/crypto/x509/x509.go
===================================================================
--- a/src/pkg/crypto/x509/x509.go
+++ b/src/pkg/crypto/x509/x509.go
@@ -660,6 +660,13 @@
return nil, err
}

+ if p.N.Sign() <= 0 {
+ return nil, errors.New("x509: RSA modulus is not a positive number")
+ }
+ if p.E <= 0 {
+ return nil, errors.New("x509: RSA public exponent is not a positive
number")
+ }
+
pub := &rsa.PublicKey{
E: p.E,
N: p.N,


--

---
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Russ Cox at Jan 31, 2013 at 3:51 pm
    LGTM

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Agl at Jan 31, 2013 at 5:55 pm
    *** Submitted as
    https://code.google.com/p/go/source/detail?r=b3af92ac5a0c ***

    crypto/x509: test for negative RSA parameters.

    Someone found software that generates negative numbers for the RSA
    modulus in an X.509 certificate. Our error messages were very poor in
    this case so this change improves that.

    Update issue 4728
    Return more helpful errors when RSA parameters are negative or zero.

    R=golang-dev, rsc
    CC=golang-dev
    https://codereview.appspot.com/7228072


    https://codereview.appspot.com/7228072/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedJan 31, '13 at 3:47p
activeJan 31, '13 at 5:55p
posts3
users2
websitegolang.org

2 users in discussion

Agl: 2 posts Russ Cox: 1 post

People

Translate

site design / logo © 2022 Grokbase