Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
a85c258e
Commit
a85c258e
authored
Nov 30, 2009
by
Christopher Wedgwood
Committed by
Russ Cox
Nov 30, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a[b:len(a)] -> a[b:]
R=r, rsc CC=agl1
https://golang.org/cl/161070
parent
68d3b6e5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
handshake_client.go
src/pkg/crypto/tls/handshake_client.go
+2
-2
handshake_messages.go
src/pkg/crypto/tls/handshake_messages.go
+5
-5
No files found.
src/pkg/crypto/tls/handshake_client.go
View file @
a85c258e
...
@@ -46,7 +46,7 @@ func (h *clientHandshake) loop(writeChan chan<- interface{}, controlChan chan<-
...
@@ -46,7 +46,7 @@ func (h *clientHandshake) loop(writeChan chan<- interface{}, controlChan chan<-
hello
.
random
[
1
]
=
byte
(
currentTime
>>
16
);
hello
.
random
[
1
]
=
byte
(
currentTime
>>
16
);
hello
.
random
[
2
]
=
byte
(
currentTime
>>
8
);
hello
.
random
[
2
]
=
byte
(
currentTime
>>
8
);
hello
.
random
[
3
]
=
byte
(
currentTime
);
hello
.
random
[
3
]
=
byte
(
currentTime
);
_
,
err
:=
io
.
ReadFull
(
config
.
Rand
,
hello
.
random
[
4
:
len
(
hello
.
random
)
]);
_
,
err
:=
io
.
ReadFull
(
config
.
Rand
,
hello
.
random
[
4
:
]);
if
err
!=
nil
{
if
err
!=
nil
{
h
.
error
(
alertInternalError
);
h
.
error
(
alertInternalError
);
return
;
return
;
...
@@ -132,7 +132,7 @@ func (h *clientHandshake) loop(writeChan chan<- interface{}, controlChan chan<-
...
@@ -132,7 +132,7 @@ func (h *clientHandshake) loop(writeChan chan<- interface{}, controlChan chan<-
// version offered in the ClientHello.
// version offered in the ClientHello.
preMasterSecret
[
0
]
=
defaultMajor
;
preMasterSecret
[
0
]
=
defaultMajor
;
preMasterSecret
[
1
]
=
defaultMinor
;
preMasterSecret
[
1
]
=
defaultMinor
;
_
,
err
=
io
.
ReadFull
(
config
.
Rand
,
preMasterSecret
[
2
:
len
(
preMasterSecret
)
]);
_
,
err
=
io
.
ReadFull
(
config
.
Rand
,
preMasterSecret
[
2
:
]);
if
err
!=
nil
{
if
err
!=
nil
{
h
.
error
(
alertInternalError
);
h
.
error
(
alertInternalError
);
return
;
return
;
...
...
src/pkg/crypto/tls/handshake_messages.go
View file @
a85c258e
...
@@ -133,7 +133,7 @@ func (m *serverHelloMsg) unmarshal(data []byte) bool {
...
@@ -133,7 +133,7 @@ func (m *serverHelloMsg) unmarshal(data []byte) bool {
return
false
return
false
}
}
m
.
sessionId
=
data
[
39
:
39
+
sessionIdLen
];
m
.
sessionId
=
data
[
39
:
39
+
sessionIdLen
];
data
=
data
[
39
+
sessionIdLen
:
len
(
data
)
];
data
=
data
[
39
+
sessionIdLen
:
];
if
len
(
data
)
<
3
{
if
len
(
data
)
<
3
{
return
false
return
false
}
}
...
@@ -196,7 +196,7 @@ func (m *certificateMsg) unmarshal(data []byte) bool {
...
@@ -196,7 +196,7 @@ func (m *certificateMsg) unmarshal(data []byte) bool {
}
}
numCerts
:=
0
;
numCerts
:=
0
;
d
:=
data
[
7
:
len
(
data
)
];
d
:=
data
[
7
:
];
for
certsLen
>
0
{
for
certsLen
>
0
{
if
len
(
d
)
<
4
{
if
len
(
d
)
<
4
{
return
false
return
false
...
@@ -205,17 +205,17 @@ func (m *certificateMsg) unmarshal(data []byte) bool {
...
@@ -205,17 +205,17 @@ func (m *certificateMsg) unmarshal(data []byte) bool {
if
uint32
(
len
(
d
))
<
3
+
certLen
{
if
uint32
(
len
(
d
))
<
3
+
certLen
{
return
false
return
false
}
}
d
=
d
[
3
+
certLen
:
len
(
d
)
];
d
=
d
[
3
+
certLen
:
];
certsLen
-=
3
+
certLen
;
certsLen
-=
3
+
certLen
;
numCerts
++
;
numCerts
++
;
}
}
m
.
certificates
=
make
([][]
byte
,
numCerts
);
m
.
certificates
=
make
([][]
byte
,
numCerts
);
d
=
data
[
7
:
len
(
data
)
];
d
=
data
[
7
:
];
for
i
:=
0
;
i
<
numCerts
;
i
++
{
for
i
:=
0
;
i
<
numCerts
;
i
++
{
certLen
:=
uint32
(
d
[
0
])
<<
24
|
uint32
(
d
[
1
])
<<
8
|
uint32
(
d
[
2
]);
certLen
:=
uint32
(
d
[
0
])
<<
24
|
uint32
(
d
[
1
])
<<
8
|
uint32
(
d
[
2
]);
m
.
certificates
[
i
]
=
d
[
3
:
3
+
certLen
];
m
.
certificates
[
i
]
=
d
[
3
:
3
+
certLen
];
d
=
d
[
3
+
certLen
:
len
(
d
)
];
d
=
d
[
3
+
certLen
:
];
}
}
return
true
;
return
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment