Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
c0b44e39
Commit
c0b44e39
authored
22 years ago
by
Martin Nilsson
Browse files
Options
Downloads
Patches
Plain Diff
Stricter types
Rev: lib/modules/SSL.pmod/session.pike:1.24
parent
387e7fba
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/modules/SSL.pmod/session.pike
+22
-17
22 additions, 17 deletions
lib/modules/SSL.pmod/session.pike
with
22 additions
and
17 deletions
lib/modules/SSL.pmod/session.pike
+
22
−
17
View file @
c0b44e39
#pike __REAL_VERSION__
//
// $Id: session.pike,v 1.24 2003/01/27 15:29:56 nilsson Exp $
/* $Id: session.pike,v 1.23 2003/01/27 15:03:00 nilsson Exp $
#pike __REAL_VERSION__
*
// #pragma strict_types
*/
//! The most important information in a session object is a
//! The most important information in a session object is a
//! choice of encryption algorithms and a "master secret" created by
//! choice of encryption algorithms and a "master secret" created by
...
@@ -29,7 +29,7 @@ int cipher_suite;
...
@@ -29,7 +29,7 @@ int cipher_suite;
//! Information about the encryption method derived from the
//! Information about the encryption method derived from the
//! cipher_suite.
//! cipher_suite.
obj
ec
t
cipher_spec;
.Cipher.CipherSp
ec cipher_spec;
//! Key exchange method, also derived from the cipher_suite.
//! Key exchange method, also derived from the cipher_suite.
int ke_method;
int ke_method;
...
@@ -49,8 +49,8 @@ void set_cipher_suite(int suite,int version)
...
@@ -49,8 +49,8 @@ void set_cipher_suite(int suite,int version)
{
{
array res = .Cipher.lookup(suite,version);
array res = .Cipher.lookup(suite,version);
cipher_suite = suite;
cipher_suite = suite;
ke_method = res[0];
ke_method =
[int]
res[0];
cipher_spec = res[1];
cipher_spec =
[object(.Cipher.CipherSpec)]
res[1];
#ifdef SSL3_DEBUG
#ifdef SSL3_DEBUG
werror("SSL.session: cipher_spec %O\n",
werror("SSL.session: cipher_spec %O\n",
mkmapping(indices(cipher_spec), values(cipher_spec)));
mkmapping(indices(cipher_spec), values(cipher_spec)));
...
@@ -65,6 +65,7 @@ void set_compression_method(int compr)
...
@@ -65,6 +65,7 @@ void set_compression_method(int compr)
compression_algorithm = compr;
compression_algorithm = compr;
}
}
//!
string generate_key_block(string client_random, string server_random, array(int) version)
string generate_key_block(string client_random, string server_random, array(int) version)
{
{
int required = 2 * (
int required = 2 * (
...
@@ -119,9 +120,10 @@ void printKey(string name , string key) {
...
@@ -119,9 +120,10 @@ void printKey(string name , string key) {
}
}
#endif
#endif
//!
array generate_keys(string client_random, string server_random, array(int) version)
array generate_keys(string client_random, string server_random, array(int) version)
{
{
obje
ct key_data = Struct(generate_key_block(client_random, server_random,version));
Stru
ct key_data = Struct(generate_key_block(client_random, server_random,version));
array keys = allocate(6);
array keys = allocate(6);
#ifdef SSL3_DEBUG
#ifdef SSL3_DEBUG
...
@@ -166,7 +168,10 @@ array generate_keys(string client_random, string server_random,array(int) versio
...
@@ -166,7 +168,10 @@ array generate_keys(string client_random, string server_random,array(int) versio
2*cipher_spec->iv_size);
2*cipher_spec->iv_size);
keys[4]=iv_block[..cipher_spec->iv_size-1];
keys[4]=iv_block[..cipher_spec->iv_size-1];
keys[5]=iv_block[cipher_spec->iv_size..];
keys[5]=iv_block[cipher_spec->iv_size..];
werror("sizeof(keys[4]):"+sizeof(keys[4])+" sizeof(keys[5]):"+sizeof(keys[4])+"\n");
#ifdef SSL3_DEBUG
werror("sizeof(keys[4]):%d sizeof(keys[5]):%d\n",
sizeof([string]keys[4]), sizeof([string]keys[4]));
#endif
}
}
}
}
...
@@ -208,12 +213,12 @@ array generate_keys(string client_random, string server_random,array(int) versio
...
@@ -208,12 +213,12 @@ array generate_keys(string client_random, string server_random,array(int) versio
//!
//!
//! @returns
//! @returns
//! @array
//! @array
//! @elem State read_state
//! @elem S
SL.s
tate read_state
//! Read state
//! Read state
//! @elem State write_state
//! @elem S
SL.s
tate write_state
//! Write state
//! Write state
//! @endarray
//! @endarray
array new_server_states(string client_random, string server_random,array(int) version)
array
(State)
new_server_states(string client_random, string server_random,
array(int) version)
{
{
State write_state = State(this_object());
State write_state = State(this_object());
State read_state = State(this_object());
State read_state = State(this_object());
...
@@ -249,12 +254,12 @@ array new_server_states(string client_random, string server_random,array(int) ve
...
@@ -249,12 +254,12 @@ array new_server_states(string client_random, string server_random,array(int) ve
//!
//!
//! @returns
//! @returns
//! @array
//! @array
//! @elem State read_state
//! @elem S
SL.s
tate read_state
//! Read state
//! Read state
//! @elem State write_state
//! @elem S
SL.s
tate write_state
//! Write state
//! Write state
//! @endarray
//! @endarray
array new_client_states(string client_random, string server_random,array(int) version)
array
(State)
new_client_states(string client_random, string server_random,array(int) version)
{
{
State write_state = State(this_object());
State write_state = State(this_object());
State read_state = State(this_object());
State read_state = State(this_object());
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment