winlin

s1 compute key.

@@ -222,12 +222,28 @@ void show_macro_features() @@ -222,12 +222,28 @@ void show_macro_features()
222 #endif 222 #endif
223 } 223 }
224 224
  225 +#include <srs_rtmp_handshake.hpp>
225 /** 226 /**
226 * main entrance. 227 * main entrance.
227 */ 228 */
228 int main(int argc, char** argv) 229 int main(int argc, char** argv)
229 { 230 {
230 int ret = ERROR_SUCCESS; 231 int ret = ERROR_SUCCESS;
  232 +
  233 + _srs_internal::SrsDH dh;
  234 + dh.initialize();
  235 +
  236 + char key[128]; int nb_key = 128;
  237 + dh.copy_public_key(key, nb_key);
  238 + for (int i = 0; i < nb_key; i++) {
  239 + printf("%#x, ", (unsigned char)key[i]);
  240 + if (((i+1) %16) == 0) {
  241 + printf("\n");
  242 + }
  243 + }
  244 +
  245 + printf("\n");
  246 + exit(0);
231 247
232 // TODO: support both little and big endian. 248 // TODO: support both little and big endian.
233 srs_assert(srs_is_little_endian()); 249 srs_assert(srs_is_little_endian());
@@ -532,7 +532,7 @@ namespace _srs_internal @@ -532,7 +532,7 @@ namespace _srs_internal
532 return ret; 532 return ret;
533 } 533 }
534 534
535 - // altough the public key is always 128bytes, but the share key maybe not. 535 + // although the public key is always 128bytes, but the share key maybe not.
536 // we just ignore the actual key size, but if need to use the key, must use the actual size. 536 // we just ignore the actual key size, but if need to use the key, must use the actual size.
537 // TODO: FIXME: use the actual key size. 537 // TODO: FIXME: use the actual key size.
538 //srs_assert(pkey_size == 128); 538 //srs_assert(pkey_size == 128);