| 866 | } |
| 867 | |
| 868 | static void |
| 869 | sctp_hmac_update(uint16_t hmac_algo, sctp_hash_context_t *ctx, |
| 870 | uint8_t *text, uint32_t textlen) |
| 871 | { |
| 872 | switch (hmac_algo) { |
| 873 | case SCTP_AUTH_HMAC_ID_SHA1: |
| 874 | SCTP_SHA1_UPDATE(&ctx->sha1, text, textlen); |
| 875 | break; |
| 876 | case SCTP_AUTH_HMAC_ID_SHA256: |
| 877 | SCTP_SHA256_UPDATE(&ctx->sha256, text, textlen); |
| 878 | break; |
| 879 | case SCTP_AUTH_HMAC_ID_RSVD: |
| 880 | default: |
| 881 | /* unknown HMAC algorithm: can't do anything */ |
| 882 | return; |
| 883 | } /* end switch */ |
| 884 | } |
| 885 | |
| 886 | static void |
| 887 | sctp_hmac_final(uint16_t hmac_algo, sctp_hash_context_t *ctx, |
no outgoing calls
no test coverage detected