Skip to content

Commit

Permalink
Skip broken PKCS overlong message test
Browse files Browse the repository at this point in the history
TestOverlongMessagePKCS1v15 tests that an error is returned on an
invalid message. We can safely skip the test, as the constraint doesn't
apply when using OpenSSL versions with implicit rejection in
RSA PKCS#1 v1.5, which would return a random message instead of an error.
  • Loading branch information
dbenoit17 committed May 20, 2024
1 parent 47f280d commit 2a1480c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions patches/004-skip-pkcs-test.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/src/crypto/rsa/pkcs1v15_test.go b/src/crypto/rsa/pkcs1v15_test.go
index f6afc363ea..c164ec5706 100644
--- a/src/crypto/rsa/pkcs1v15_test.go
+++ b/src/crypto/rsa/pkcs1v15_test.go
@@ -245,6 +245,10 @@ func TestVerifyPKCS1v15(t *testing.T) {
}

func TestOverlongMessagePKCS1v15(t *testing.T) {
+ // OpenSSL now returns a random string instead of an error
+ if boring.Enabled() {
+ t.Skip("Not relevant in boring mode")
+ }
ciphertext := decodeBase64("fjOVdirUzFoLlukv80dBllMLjXythIf22feqPrNo0YoIjzyzyoMFiLjAc/Y4krkeZ11XFThIrEvw\nkRiZcCq5ng==")
_, err := DecryptPKCS1v15(nil, rsaPrivateKey, ciphertext)
if err == nil {

0 comments on commit 2a1480c

Please sign in to comment.