File: 0004-Disable-TestHandler_validateJWS-fail-rsa-key-too-sma.patch

package info (click to toggle)
golang-github-smallstep-certificates 0.28.4-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,684 kB
  • sloc: sh: 367; makefile: 129
file content (79 lines) | stat: -rw-r--r-- 2,615 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
From: Peymaneh <peymaneh@posteo.net>
Date: Mon, 28 Nov 2022 00:40:58 +0100
Subject: Disable TestHandler_validateJWS/fail/rsa-key-too-small

Testing for RSA-key size was moved to go.step.sm/crypto,
which will throw an error by itself, but this version
of smallstep/certificates is still running the test as if
go.step.sm/crypto would return the function.

forwarded: not-needed
---
 acme/api/middleware_test.go | 56 ++++++++++++++++++++++-----------------------
 1 file changed, 28 insertions(+), 28 deletions(-)

--- a/acme/api/middleware_test.go
+++ b/acme/api/middleware_test.go
@@ -1135,34 +1135,34 @@
 				err:        acme.NewError(acme.ErrorMalformedType, "jws key type and algorithm do not match"),
 			}
 		},
-		"fail/rsa-key-too-small": func(t *testing.T) test {
-			jwk, err := jose.GenerateJWK("RSA", "", "", "sig", "", 1024)
-			assert.FatalError(t, err)
-			pub := jwk.Public()
-			jws := &jose.JSONWebSignature{
-				Signatures: []jose.Signature{
-					{
-						Protected: jose.Header{
-							Algorithm:  jose.RS256,
-							JSONWebKey: &pub,
-							ExtraHeaders: map[jose.HeaderKey]interface{}{
-								"url": u,
-							},
-						},
-					},
-				},
-			}
-			return test{
-				db: &acme.MockDB{
-					MockDeleteNonce: func(ctx context.Context, n acme.Nonce) error {
-						return nil
-					},
-				},
-				ctx:        context.WithValue(context.Background(), jwsContextKey, jws),
-				statusCode: 400,
-				err:        acme.NewError(acme.ErrorMalformedType, "rsa keys must be at least 2048 bits (256 bytes) in size"),
-			}
-		},
+		//		"fail/rsa-key-too-small": func(t *testing.T) test {
+		//			jwk, err := jose.GenerateJWK("RSA", "", "", "sig", "", 1024)
+		//			assert.FatalError(t, err)
+		//			pub := jwk.Public()
+		//			jws := &jose.JSONWebSignature{
+		//				Signatures: []jose.Signature{
+		//					{
+		//						Protected: jose.Header{
+		//							Algorithm:  jose.RS256,
+		//							JSONWebKey: &pub,
+		//							ExtraHeaders: map[jose.HeaderKey]interface{}{
+		//								"url": u,
+		//							},
+		//						},
+		//					},
+		//				},
+		//			}
+		//			return test{
+		//				db: &acme.MockDB{
+		//					MockDeleteNonce: func(ctx context.Context, n acme.Nonce) error {
+		//						return nil
+		//					},
+		//				},
+		//				ctx:        context.WithValue(context.Background(), jwsContextKey, jws),
+		//				statusCode: 400,
+		//				err:        acme.NewError(acme.ErrorMalformedType, "rsa keys must be at least 2048 bits (256 bytes) in size"),
+		//			}
+		//		},
 		"fail/UseNonce-error": func(t *testing.T) test {
 			jws := &jose.JSONWebSignature{
 				Signatures: []jose.Signature{