Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Commit

Permalink
supress error for RSA_ENCRYPT_EXP not found
Browse files Browse the repository at this point in the history
  • Loading branch information
lyc8503 committed Jan 25, 2023
1 parent 4a365b6 commit 7a1dc42
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/web_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@ func WebLogin(server string, username string, password string) (string, error) {
rsaKey := string(regexp.MustCompile(`<RSA_ENCRYPT_KEY>(.*)</RSA_ENCRYPT_KEY>`).FindSubmatch(buf[:n])[1])
log.Printf("RSA Key: %s", rsaKey)

rsaExp := string(regexp.MustCompile(`<RSA_ENCRYPT_EXP>(.*)</RSA_ENCRYPT_EXP>`).FindSubmatch(buf[:n])[1])
rsaExpMatch := regexp.MustCompile(`<RSA_ENCRYPT_EXP>(.*)</RSA_ENCRYPT_EXP>`).FindSubmatch(buf[:n])
rsaExp := ""
if rsaExpMatch != nil {
rsaExp = string(rsaExpMatch[1])
} else {
log.Printf("Warning: No RSA_ENCRYPT_EXP, using default.")
rsaExp = "65537"
}
log.Printf("RSA Exp: %s", rsaExp)

csrfMatch := regexp.MustCompile(`<CSRF_RAND_CODE>(.*)</CSRF_RAND_CODE>`).FindSubmatch(buf[:n])
Expand Down

0 comments on commit 7a1dc42

Please sign in to comment.