tport_rand.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * This file is part of the Sofia-SIP package
  3. *
  4. * Copyright (C) 2005 Nokia Corporation.
  5. *
  6. * Contact: Pekka Pessi <pekka.pessi@nokia.com>
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public License
  10. * as published by the Free Software Foundation; either version 2.1 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with this library; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  21. * 02110-1301 USA
  22. *
  23. */
  24. #include <openssl/rand.h>
  25. int main(int argc, char **argv)
  26. {
  27. int nb;
  28. if (argc != 2) {
  29. printf("Usage: tport_rand <output seed file>\n");
  30. exit(0);
  31. }
  32. printf("Please move mouse for until the application stops\n");
  33. RAND_load_file("/dev/random", 1024);
  34. RAND_write_file(argv[1]);
  35. nb = RAND_load_file(argv[1], -1);
  36. printf("Wrote %d bytes to the seed file\n", nb);
  37. return 0;
  38. }