Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Commit 2589335

Browse files
committed
cell.go: ignore unknown certificate types
1 parent 2fee294 commit 2589335

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cell.go

+6
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,14 @@ func (tc *TorConn) readCertsCell() (
112112
if _, err = io.ReadFull(payload, certCER); err != nil {
113113
return
114114
}
115+
116+
if !(certType == 1 || certType == 2 || certType == 3) {
117+
continue
118+
}
119+
115120
cert, err := x509.ParseCertificate(certCER)
116121
if err != nil {
122+
fmt.Printf("%x\n%x\n%s\n", c.payload, certCER, err)
117123
return nil, nil, nil, err
118124
}
119125
switch certType {

0 commit comments

Comments
 (0)