summaryrefslogtreecommitdiff
path: root/src/pkg/crypto/tls/parse-gnutls-cli-debug-log.py
diff options
context:
space:
mode:
authorMichael Stapelberg <stapelberg@debian.org>2013-03-04 21:27:36 +0100
committerMichael Stapelberg <michael@stapelberg.de>2013-03-04 21:27:36 +0100
commit04b08da9af0c450d645ab7389d1467308cfc2db8 (patch)
treedb247935fa4f2f94408edc3acd5d0d4f997aa0d8 /src/pkg/crypto/tls/parse-gnutls-cli-debug-log.py
parent917c5fb8ec48e22459d77e3849e6d388f93d3260 (diff)
downloadgolang-upstream/1.1_hg20130304.tar.gz
Imported Upstream version 1.1~hg20130304upstream/1.1_hg20130304
Diffstat (limited to 'src/pkg/crypto/tls/parse-gnutls-cli-debug-log.py')
-rw-r--r--src/pkg/crypto/tls/parse-gnutls-cli-debug-log.py57
1 files changed, 0 insertions, 57 deletions
diff --git a/src/pkg/crypto/tls/parse-gnutls-cli-debug-log.py b/src/pkg/crypto/tls/parse-gnutls-cli-debug-log.py
deleted file mode 100644
index 5692bd32f..000000000
--- a/src/pkg/crypto/tls/parse-gnutls-cli-debug-log.py
+++ /dev/null
@@ -1,57 +0,0 @@
-# Copyright 2010 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-# This code is used to parse the debug log from gnutls-cli and generate a
-# script of the handshake. This script is included in handshake_server_test.go.
-# See the comments there for details.
-
-import sys
-
-blocks = []
-
-READ = 1
-WRITE = 2
-
-currentBlockType = 0
-currentBlock = []
-for line in sys.stdin.readlines():
- line = line[:-1]
- if line.startswith("|<7>| WRITE: "):
- if currentBlockType != WRITE:
- if len(currentBlock) > 0:
- blocks.append(currentBlock)
- currentBlock = []
- currentBlockType = WRITE
- elif line.startswith("|<7>| READ: "):
- if currentBlockType != READ:
- if len(currentBlock) > 0:
- blocks.append(currentBlock)
- currentBlock = []
- currentBlockType = READ
- elif line.startswith("|<7>| 0"):
- line = line[13:]
- line = line.strip()
- bs = line.split()
- for b in bs:
- currentBlock.append(int(b, 16))
- elif line.startswith("|<7>| RB-PEEK: Read 1 bytes"):
- currentBlock = currentBlock[:-1]
-
-if len(currentBlock) > 0:
- blocks.append(currentBlock)
-
-for block in blocks:
- sys.stdout.write("\t{\n")
-
- i = 0
- for b in block:
- if i % 8 == 0:
- sys.stdout.write("\t\t")
- sys.stdout.write("0x%02x," % b)
- if i % 8 == 7:
- sys.stdout.write("\n")
- else:
- sys.stdout.write(" ")
- i += 1
- sys.stdout.write("\n\t},\n\n")