Merge "handle CMS pem format easier"

This commit is contained in:
Jenkins 2016-05-05 18:00:05 +00:00 committed by Gerrit Code Review
commit 63a095c4c0
1 changed files with 2 additions and 3 deletions

View File

@ -194,11 +194,10 @@ func base64DecodeFromCms(token string) ([]byte, error) {
// -----BEGIN CMS----- // -----BEGIN CMS-----
// -----END CMS----- // -----END CMS-----
func trimCMSFormat(token string) string { func trimCMSFormat(token string) string {
token = strings.Trim(token, "\n")
l := strings.Index(token, "\n") l := strings.Index(token, "\n")
r := strings.LastIndex(token, "\n") r := strings.LastIndex(token, "\n")
t := token[l:r] return token[l:r]
r2 := strings.LastIndex(t, "\n")
return t[0:r2]
} }
// Get the signging certificate from local dir // Get the signging certificate from local dir