auth_test_cases.c 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. *
  3. * Copyright (c) 2013-2021, Cisco Systems, Inc.
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. *
  13. * Redistributions in binary form must reproduce the above
  14. * copyright notice, this list of conditions and the following
  15. * disclaimer in the documentation and/or other materials provided
  16. * with the distribution.
  17. *
  18. * Neither the name of the Cisco Systems, Inc. nor the names of its
  19. * contributors may be used to endorse or promote products derived
  20. * from this software without specific prior written permission.
  21. *
  22. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  23. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  24. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  25. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  26. * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  27. * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  28. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  29. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  30. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  31. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  32. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  33. * OF THE POSSIBILITY OF SUCH DAMAGE.
  34. *
  35. */
  36. #include "auth_test_cases.h"
  37. #include <stddef.h>
  38. /* clang-format off */
  39. static const uint8_t srtp_hmac_test_case_0_key[20] = {
  40. 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
  41. 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
  42. 0x0b, 0x0b, 0x0b, 0x0b
  43. };
  44. /* clang-format on */
  45. /* clang-format off */
  46. static const uint8_t srtp_hmac_test_case_0_data[8] = {
  47. 0x48, 0x69, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65 /* "Hi There" */
  48. };
  49. /* clang-format on */
  50. /* clang-format off */
  51. static const uint8_t srtp_hmac_test_case_0_tag[20] = {
  52. 0xb6, 0x17, 0x31, 0x86, 0x55, 0x05, 0x72, 0x64,
  53. 0xe2, 0x8b, 0xc0, 0xb6, 0xfb, 0x37, 0x8c, 0x8e,
  54. 0xf1, 0x46, 0xbe, 0x00
  55. };
  56. /* clang-format on */
  57. const srtp_auth_test_case_t srtp_hmac_test_case_0 = {
  58. sizeof(srtp_hmac_test_case_0_key), /* octets in key */
  59. srtp_hmac_test_case_0_key, /* key */
  60. sizeof(srtp_hmac_test_case_0_data), /* octets in data */
  61. srtp_hmac_test_case_0_data, /* data */
  62. sizeof(srtp_hmac_test_case_0_tag), /* octets in tag */
  63. srtp_hmac_test_case_0_tag, /* tag */
  64. NULL /* pointer to next testcase */
  65. };