opensslmd5_link.c revision a7d792804f564aa0889a94f64913b11bffd9738c
68a8db1efb0cd13e0e3d59362ab9db1a4a8bc496Andreas Gustafsson * Portions Copyright (c) 1995-1998 by Network Associates, Inc.
68a8db1efb0cd13e0e3d59362ab9db1a4a8bc496Andreas Gustafsson * Permission to use, copy modify, and distribute this software for any
68a8db1efb0cd13e0e3d59362ab9db1a4a8bc496Andreas Gustafsson * purpose with or without fee is hereby granted, provided that the above
68a8db1efb0cd13e0e3d59362ab9db1a4a8bc496Andreas Gustafsson * copyright notice and this permission notice appear in all copies.
68a8db1efb0cd13e0e3d59362ab9db1a4a8bc496Andreas Gustafsson * THE SOFTWARE IS PROVIDED "AS IS" AND NETWORK ASSOCIATES
68a8db1efb0cd13e0e3d59362ab9db1a4a8bc496Andreas Gustafsson * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
68a8db1efb0cd13e0e3d59362ab9db1a4a8bc496Andreas Gustafsson * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
68a8db1efb0cd13e0e3d59362ab9db1a4a8bc496Andreas Gustafsson * NETWORK ASSOCIATES BE LIABLE FOR ANY SPECIAL, DIRECT,
68a8db1efb0cd13e0e3d59362ab9db1a4a8bc496Andreas Gustafsson * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
68a8db1efb0cd13e0e3d59362ab9db1a4a8bc496Andreas Gustafsson * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
68a8db1efb0cd13e0e3d59362ab9db1a4a8bc496Andreas Gustafsson * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
68a8db1efb0cd13e0e3d59362ab9db1a4a8bc496Andreas Gustafsson * WITH THE USE OR PERFORMANCE OF THE SOFTWARE.
bd3946db298667e769804b2e978df2d6dcd85e29Mark Andrews * Principal Author: Brian Wellington
4848fe4ad2c0ba6e2e69e4a2617727f8556d79a0Andreas Gustafsson * $Id: opensslmd5_link.c,v 1.2 1999/10/20 22:14:15 bwelling Exp $
4848fe4ad2c0ba6e2e69e4a2617727f8556d79a0Andreas Gustafsson * Call MD5 functions to digest a block of data.
4848fe4ad2c0ba6e2e69e4a2617727f8556d79a0Andreas Gustafsson * There are three steps to signing, INIT (initialize structures),
4848fe4ad2c0ba6e2e69e4a2617727f8556d79a0Andreas Gustafsson * UPDATE (hash (more) data), FINAL (generate a digest). This
4848fe4ad2c0ba6e2e69e4a2617727f8556d79a0Andreas Gustafsson * routine performs one or more of these steps.
4848fe4ad2c0ba6e2e69e4a2617727f8556d79a0Andreas Gustafsson * mode DST_SIGMODE_{INIT_UPDATE_FINAL|ALL}
4848fe4ad2c0ba6e2e69e4a2617727f8556d79a0Andreas Gustafsson * context the context to use for this computation
4848fe4ad2c0ba6e2e69e4a2617727f8556d79a0Andreas Gustafsson * data data to be signed
4848fe4ad2c0ba6e2e69e4a2617727f8556d79a0Andreas Gustafsson * digest buffer to store digest
4848fe4ad2c0ba6e2e69e4a2617727f8556d79a0Andreas Gustafsson * mctx memory context for temporary allocations
4848fe4ad2c0ba6e2e69e4a2617727f8556d79a0Andreas Gustafsson * ISC_R_SUCCESS Success
4848fe4ad2c0ba6e2e69e4a2617727f8556d79a0Andreas Gustafsson * !ISC_R_SUCCESS Failure
4848fe4ad2c0ba6e2e69e4a2617727f8556d79a0Andreas Gustafssondst_s_md5(const unsigned int mode, void **context, isc_region_t *data,
4848fe4ad2c0ba6e2e69e4a2617727f8556d79a0Andreas Gustafsson ctx = (MD5_CTX *) isc_mem_get(mctx, sizeof(MD5_CTX));