mirror of
https://github.com/ossrs/srs.git
synced 2025-02-13 11:51:57 +00:00
s1 compute key.
This commit is contained in:
parent
cafe886c3f
commit
6191e0af90
2 changed files with 17 additions and 1 deletions
|
@ -222,6 +222,7 @@ void show_macro_features()
|
|||
#endif
|
||||
}
|
||||
|
||||
#include <srs_rtmp_handshake.hpp>
|
||||
/**
|
||||
* main entrance.
|
||||
*/
|
||||
|
@ -229,6 +230,21 @@ int main(int argc, char** argv)
|
|||
{
|
||||
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.
|
||||
srs_assert(srs_is_little_endian());
|
||||
|
||||
|
|
|
@ -532,7 +532,7 @@ namespace _srs_internal
|
|||
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.
|
||||
// TODO: FIXME: use the actual key size.
|
||||
//srs_assert(pkey_size == 128);
|
||||
|
|
Loading…
Reference in a new issue