(ident string)
| 550 | var regSSHIdent = regexp.MustCompile(`^(SSH-[0-9]\.?[0-9]?)-(.*[[:word:]]*)_([0-9]\.[0-9]?\.?[[:alnum:]]?[[:alnum:]]?)[[:space:]]?([[:alnum:]]*)`) |
| 551 | |
| 552 | func parseSSHIdent(ident string) *sshVersionInfo { |
| 553 | if m := regSSHIdent.FindStringSubmatch(ident); len(m) > 0 { |
| 554 | var os string |
| 555 | if len(m) > 4 { |
| 556 | os = m[4] |
| 557 | } |
| 558 | |
| 559 | return &sshVersionInfo{ |
| 560 | sshVersion: m[1], |
| 561 | productName: m[2], |
| 562 | productVersion: m[3], |
| 563 | os: os, |
| 564 | } |
| 565 | } |
| 566 | |
| 567 | return nil |
| 568 | } |
| 569 | |
| 570 | // buildAlgorithmsString creates a summary of the SSH algorithms from KexInit |
| 571 | func buildAlgorithmsString(init KexInitMsg) string { |
no outgoing calls