| 1 |
Description: Fix and patch relevant upstream code for fixing autopkgtests with golang-1.16 |
| 2 |
Author: Nilesh Patra <[email protected]> |
| 3 |
Forwarded: not-needed |
| 4 |
Last-Update: 2021-09-08 |
| 5 |
--- a/fullsailor/pkcs7/pkcs7_test.go |
| 6 |
+++ b/fullsailor/pkcs7/pkcs7_test.go |
| 7 |
@@ -16,6 +16,7 @@ |
| 8 |
"math/big" |
| 9 |
"os" |
| 10 |
"os/exec" |
| 11 |
+ "strings" |
| 12 |
"testing" |
| 13 |
"time" |
| 14 |
) |
| 15 |
@@ -28,7 +29,11 @@ |
| 16 |
} |
| 17 |
|
| 18 |
if err := p7.Verify(); err != nil { |
| 19 |
|
| 20 |
+ if strings.Contains(err.Error(), "algorithm unimplemented") { |
| 21 |
+ t.Skip("DSA is not supported since go1.16, ignoring:", err) |
| 22 |
+ } else { |
| 23 |
+ t.Errorf("Verify failed with error: %v", err) |
| 24 |
+ } |
| 25 |
} |
| 26 |
expected := []byte("We the People") |
| 27 |
if bytes.Compare(p7.Content, expected) != 0 { |
| 28 |
--- a/schemev1.go |
| 29 |
+++ b/schemev1.go |
| 30 |
@@ -811,9 +811,11 @@ |
| 31 |
return fmt.Errorf("Unexpected public key type (%T)!", cert.PublicKey) |
| 32 |
} |
| 33 |
return rsa.VerifyPKCS1v15(pub, crypto.SHA224, digest[:], signature) |
| 34 |
|
| 35 |
+ case x509.DSAWithSHA1, DSAWithSHA224, x509.DSAWithSHA256: |
| 36 |
var hasher hash.Hash |
| 37 |
switch algo { |
| 38 |
+ case x509.DSAWithSHA1: |
| 39 |
+ hasher = sha1.New() |
| 40 |
case x509.DSAWithSHA256: |
| 41 |
hasher = sha256.New() |
| 42 |
case DSAWithSHA224: |