mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
s1 compute key.
This commit is contained in:
parent
cafe886c3f
commit
6191e0af90
2 changed files with 17 additions and 1 deletions
|
@ -222,12 +222,28 @@ void show_macro_features()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include <srs_rtmp_handshake.hpp>
|
||||||
/**
|
/**
|
||||||
* main entrance.
|
* main entrance.
|
||||||
*/
|
*/
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
int ret = ERROR_SUCCESS;
|
int ret = ERROR_SUCCESS;
|
||||||
|
|
||||||
|
_srs_internal::SrsDH dh;
|
||||||
|
dh.initialize();
|
||||||
|
|
||||||
|
char key[128]; int nb_key = 128;
|
||||||
|
dh.copy_public_key(key, nb_key);
|
||||||
|
for (int i = 0; i < nb_key; i++) {
|
||||||
|
printf("%#x, ", (unsigned char)key[i]);
|
||||||
|
if (((i+1) %16) == 0) {
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("\n");
|
||||||
|
exit(0);
|
||||||
|
|
||||||
// TODO: support both little and big endian.
|
// TODO: support both little and big endian.
|
||||||
srs_assert(srs_is_little_endian());
|
srs_assert(srs_is_little_endian());
|
||||||
|
|
|
@ -532,7 +532,7 @@ namespace _srs_internal
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
// altough the public key is always 128bytes, but the share key maybe not.
|
// although the public key is always 128bytes, but the share key maybe not.
|
||||||
// we just ignore the actual key size, but if need to use the key, must use the actual size.
|
// we just ignore the actual key size, but if need to use the key, must use the actual size.
|
||||||
// TODO: FIXME: use the actual key size.
|
// TODO: FIXME: use the actual key size.
|
||||||
//srs_assert(pkey_size == 128);
|
//srs_assert(pkey_size == 128);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue