summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-09-01 17:36:25 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-09-01 17:36:25 +0200
commit1c57ea9aa50dba053fa875a08c73b687e38862ba (patch)
treed9c22429a0fa574f6f341eafd050d7c20a47fe96
parent13a19d8e1fd8672f48c1ea6ab3b492158b2bc842 (diff)
Add old IP
-rw-r--r--main.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/main.go b/main.go
index 2f2d02a..47b5d47 100644
--- a/main.go
+++ b/main.go
@@ -5,6 +5,7 @@ import (
"crypto/rsa"
"crypto/x509"
"encoding/hex"
+ "errors"
"fmt"
"log"
"net"
@@ -12,7 +13,7 @@ import (
)
const (
- host = `ownme.ipredator.se` // 198.167.222.202
+ host = `ownme.ipredator.se` // 198.167.222.202 or 46.246.46.123
clientPort = `:10002`
serverPort = `:10000`
)
@@ -52,6 +53,9 @@ var data = make(map[Direction]Data)
func (dir Direction) sniffCert(b []byte) error {
if i := bytes.Index(b, []byte{0x30, 0x82, 0x04, 0x2f}); i >= 0 {
+ if len(b) < i+1075 {
+ return errors.New("too short")
+ }
cert := b[i : i+1075]
crt, err := x509.ParseCertificate(cert)
if err != nil {