Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libnice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
libnice
Commits
37c40e29
Commit
37c40e29
authored
Aug 06, 2008
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a new test for the long term hash credentials
parent
601cf443
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
stun/tests/test-parse.c
stun/tests/test-parse.c
+31
-0
No files found.
stun/tests/test-parse.c
View file @
37c40e29
...
@@ -603,11 +603,42 @@ static void test_vectors (void)
...
@@ -603,11 +603,42 @@ static void test_vectors (void)
puts
(
"Done."
);
puts
(
"Done."
);
}
}
static
void
test_hash_creds
(
void
)
{
uint8_t
md5
[
16
];
uint8_t
real_md5
[]
=
{
0x84
,
0x93
,
0xfb
,
0xc5
,
0x3b
,
0xa5
,
0x82
,
0xfb
,
0x4c
,
0x04
,
0x4c
,
0x45
,
0x6b
,
0xdc
,
0x40
,
0xeb
};
puts
(
"Testing long term credentials hash algorithm..."
);
stun_hash_creds
(
"realm"
,
strlen
(
"realm"
),
"user"
,
strlen
(
"user"
),
"pass"
,
strlen
(
"pass"
),
md5
);
stun_debug
(
"key for user:realm:pass is : "
);
stun_debug_bytes
(
md5
,
16
);
stun_debug
(
"
\n\n
"
);
stun_debug
(
"RFC key for user:realm:pass is : "
);
stun_debug_bytes
(
real_md5
,
16
);
stun_debug
(
"
\n\n
"
);
if
(
memcmp
(
md5
,
real_md5
,
sizeof
(
md5
))
!=
0
)
fatal
(
"MD5 hashes are different!"
);
puts
(
"Done!"
);
}
int
main
(
void
)
int
main
(
void
)
{
{
test_message
();
test_message
();
test_attribute
();
test_attribute
();
test_vectors
();
test_vectors
();
test_hash_creds
();
return
0
;
return
0
;
}
}
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