| 849 | } |
| 850 | |
| 851 | static void |
| 852 | sctp_hmac_init(uint16_t hmac_algo, sctp_hash_context_t *ctx) |
| 853 | { |
| 854 | switch (hmac_algo) { |
| 855 | case SCTP_AUTH_HMAC_ID_SHA1: |
| 856 | SCTP_SHA1_INIT(&ctx->sha1); |
| 857 | break; |
| 858 | case SCTP_AUTH_HMAC_ID_SHA256: |
| 859 | SCTP_SHA256_INIT(&ctx->sha256); |
| 860 | break; |
| 861 | case SCTP_AUTH_HMAC_ID_RSVD: |
| 862 | default: |
| 863 | /* unknown HMAC algorithm: can't do anything */ |
| 864 | return; |
| 865 | } /* end switch */ |
| 866 | } |
| 867 | |
| 868 | static void |
| 869 | sctp_hmac_update(uint16_t hmac_algo, sctp_hash_context_t *ctx, |
no outgoing calls
no test coverage detected