diff --git a/aws/resource_aws_iam_server_certificate.go b/aws/resource_aws_iam_server_certificate.go index 658bc181f9b..476f16ac88b 100644 --- a/aws/resource_aws_iam_server_certificate.go +++ b/aws/resource_aws_iam_server_certificate.go @@ -1,8 +1,6 @@ package aws import ( - "crypto/sha1" - "encoding/hex" "fmt" "log" "regexp" @@ -230,20 +228,6 @@ func normalizeCert(cert interface{}) string { return "" } - cleanVal := sha1.Sum(stripCR([]byte(strings.TrimSpace(rawCert)))) - return hex.EncodeToString(cleanVal[:]) -} - -// strip CRs from raw literals. Lifted from go/scanner/scanner.go -// See https://github.com/golang/go/blob/release-branch.go1.6/src/go/scanner/scanner.go#L479 -func stripCR(b []byte) []byte { - c := make([]byte, len(b)) - i := 0 - for _, ch := range b { - if ch != '\r' { - c[i] = ch - i++ - } - } - return c[:i] + cleanVal := strings.TrimSpace(rawCert) + return cleanVal }