view src/lib/hmac-md5.h @ 9191:b340ecb24469 HEAD

Fix VPATH build of RQUOTA support. Some rpcgen derive #include "..." paths from the infile argument. This will be off for VPATH builds, as the generated rquota_xdr.c code will look in $(srcdir), but we'll generate the rquota.h file in $(builddir). Play safe and copy rquota.x to $(builddir) first. This fixes the build on openSUSE 11.1.
author Matthias Andree <matthias.andree@gmx.de>
date Tue, 07 Jul 2009 21:01:36 +0200
parents e4eb71ae8e96
children
line wrap: on
line source

#ifndef HMAC_MD5_H
#define HMAC_MD5_H

#include "md5.h"

#define CRAM_MD5_CONTEXTLEN 32

struct hmac_md5_context {
	struct md5_context ctx, ctxo;
};

void hmac_md5_init(struct hmac_md5_context *ctx,
		   const unsigned char *key, size_t key_len);
void hmac_md5_final(struct hmac_md5_context *ctx,
		    unsigned char digest[MD5_RESULTLEN]);

void hmac_md5_get_cram_context(struct hmac_md5_context *ctx,
		unsigned char context_digest[CRAM_MD5_CONTEXTLEN]);
void hmac_md5_set_cram_context(struct hmac_md5_context *ctx,
		const unsigned char context_digest[CRAM_MD5_CONTEXTLEN]);


static inline void
hmac_md5_update(struct hmac_md5_context *ctx, const void *data, size_t size)
{
	md5_update(&ctx->ctx, data, size);
}

#endif