- * serialize the HMAC algo list and return space used * caller must guarantee ptr has appropriate space */
| 746 | * caller must guarantee ptr has appropriate space |
| 747 | */ |
| 748 | int |
| 749 | sctp_serialize_hmaclist(sctp_hmaclist_t *list, uint8_t *ptr) |
| 750 | { |
| 751 | int i; |
| 752 | uint16_t hmac_id; |
| 753 | |
| 754 | if (list == NULL) |
| 755 | return (0); |
| 756 | |
| 757 | for (i = 0; i < list->num_algo; i++) { |
| 758 | hmac_id = htons(list->hmac[i]); |
| 759 | memcpy(ptr, &hmac_id, sizeof(hmac_id)); |
| 760 | ptr += sizeof(hmac_id); |
| 761 | } |
| 762 | return (list->num_algo * sizeof(hmac_id)); |
| 763 | } |
| 764 | |
| 765 | int |
| 766 | sctp_verify_hmac_param(struct sctp_auth_hmac_algo *hmacs, uint32_t num_hmacs) |
no test coverage detected