Trim SMTP response (#237)
this avoids to have \r\n in the error message
This commit is contained in:
parent
c3ef8dcd8b
commit
f5b169cbd4
@ -29,6 +29,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"github.com/zmap/zgrab2"
|
"github.com/zmap/zgrab2"
|
||||||
@ -265,7 +266,7 @@ func (scanner *Scanner) Scan(target zgrab2.ScanTarget) (zgrab2.ScanStatus, inter
|
|||||||
return zgrab2.TryGetScanStatus(err), result, err
|
return zgrab2.TryGetScanStatus(err), result, err
|
||||||
}
|
}
|
||||||
if code < 200 || code >= 300 {
|
if code < 200 || code >= 300 {
|
||||||
return zgrab2.SCAN_APPLICATION_ERROR, result, fmt.Errorf("SMTP error code %d returned from STARTTLS command (%s)", code, ret)
|
return zgrab2.SCAN_APPLICATION_ERROR, result, fmt.Errorf("SMTP error code %d returned from STARTTLS command (%s)", code, strings.TrimSpace(ret))
|
||||||
}
|
}
|
||||||
tlsConn, err := scanner.config.TLSFlags.GetTLSConnection(conn.Conn)
|
tlsConn, err := scanner.config.TLSFlags.GetTLSConnection(conn.Conn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user