Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* Copyright (c) 2014, Google Inc.
  2. *
  3. * Permission to use, copy, modify, and/or distribute this software for any
  4. * purpose with or without fee is hereby granted, provided that the above
  5. * copyright notice and this permission notice appear in all copies.
  6. *
  7. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  8. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  9. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  10. * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  11. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  12. * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  13. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
  14. #include <string>
  15. #include <vector>
  16. #include <openssl/err.h>
  17. #include <openssl/ssl.h>
  18. #if !defined(OPENSSL_WINDOWS)
  19. bool Client(const std::vector<std::string> &args);
  20. #endif
  21. bool DoPKCS12(const std::vector<std::string> &args);
  22. bool Speed(const std::vector<std::string> &args);
  23. static void usage(const char *name) {
  24. printf("Usage: %s [speed|client|pkcs12]\n", name);
  25. }
  26. int main(int argc, char **argv) {
  27. std::string tool;
  28. if (argc >= 2) {
  29. tool = argv[1];
  30. }
  31. SSL_library_init();
  32. std::vector<std::string> args;
  33. for (int i = 2; i < argc; i++) {
  34. args.push_back(argv[i]);
  35. }
  36. if (tool == "speed") {
  37. return !Speed(args);
  38. #if !defined(OPENSSL_WINDOWS)
  39. } else if (tool == "s_client" || tool == "client") {
  40. return !Client(args);
  41. #endif
  42. } else if (tool == "pkcs12") {
  43. return !DoPKCS12(args);
  44. } else {
  45. usage(argv[0]);
  46. return 1;
  47. }
  48. }