static int dcrypt_gnutls_ctx_hmac_final(struct dcrypt_context_hmac *ctx, buffer_t *result, const char **error_r) { size_t hlen = gnutls_hmac_get_len(ctx->md); unsigned char buf[hlen]; gnutls_hmac_output(ctx->ctx, buf); buffer_append(result, buf, hlen); return 0; }
_public_ int dnssec_tsig_write(dnssec_tsig_ctx_t *ctx, uint8_t *mac) { if (!ctx || !mac) { return DNSSEC_EINVAL; } gnutls_hmac_output(ctx->hash, mac); return DNSSEC_EOK; }