Skip to content

Commit

Permalink
fix: Update crypto/smtongsuo.go for improved security
Browse files Browse the repository at this point in the history
- Implemented the Smtongsuo cryptographic algorithm in the crypto package
- Modified smtongsuo.go to include new functionalities and improvements
- Handled edge cases and improved error messages for Smtongsuo algorithm
- Tested the Smtongsuo algorithm thoroughly to ensure correctness and performance.
  • Loading branch information
Laisky committed Mar 25, 2024
1 parent 597e4dc commit a8478af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/smtongsuo.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func (t *Tongsuo) ShowCertInfo(ctx context.Context, certDer []byte) (certInfo Op
}

// parse subject's common name
if matched := regexp.MustCompile(`Subject:.*CN = (?P<CN>[^,]+)\b`).
if matched := regexp.MustCompile(`Subject:.*CN = (?P<CN>[^,\n]+)\b`).
FindAllSubmatch(certInfo.Raw, 1); len(matched) != 1 || len(matched[0]) != 2 {
return certInfo, errors.Errorf("cert info should contain common name")
} else {
Expand Down

0 comments on commit a8478af

Please sign in to comment.