Skip to content

Commit e7d870e

Browse files
authored
Merge pull request #574 from hashicorp/lint-fix
Remove unused AES-256-CBC support and update linter config
2 parents 6630612 + 0c3a596 commit e7d870e

1 file changed

Lines changed: 0 additions & 18 deletions

File tree

builder/azure/pkcs12/crypto.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,15 @@ package pkcs12
66

77
import (
88
"bytes"
9-
"crypto/aes"
109
"crypto/cipher"
1110
"crypto/des"
1211
"crypto/rand"
13-
"crypto/sha256"
1412
"crypto/x509/pkix"
1513
"encoding/asn1"
1614
"errors"
1715
"io"
1816

1917
"github.com/hashicorp/packer-plugin-azure/builder/azure/pkcs12/rc2"
20-
"golang.org/x/crypto/pbkdf2"
2118
)
2219

2320
const (
@@ -69,21 +66,6 @@ func (shaWith40BitRC2CBC) deriveIV(salt, password []byte, iterations int) []byte
6966
return pbkdf(sha1Sum, 20, 64, salt, password, iterations, 2, 8)
7067
}
7168

72-
// Modern AES-256-CBC cipher using PBKDF2
73-
type aes256CBC struct{}
74-
75-
func (aes256CBC) create(key []byte) (cipher.Block, error) {
76-
return aes.NewCipher(key)
77-
}
78-
79-
func (aes256CBC) deriveKey(salt, password []byte, iterations int) []byte {
80-
return pbkdf2.Key(password, salt, iterations, 32, sha256.New)
81-
}
82-
83-
func (aes256CBC) deriveIV(salt, password []byte, iterations int) []byte {
84-
return pbkdf2.Key(password, salt, iterations, 16, sha256.New)
85-
}
86-
8769
type pbeParams struct {
8870
Salt []byte
8971
Iterations int

0 commit comments

Comments
 (0)