m_dss.c revision 55714
11541Srgrimes/* crypto/evp/m_dss.c */
21541Srgrimes/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
31541Srgrimes * All rights reserved.
41541Srgrimes *
51541Srgrimes * This package is an SSL implementation written
61541Srgrimes * by Eric Young (eay@cryptsoft.com).
71541Srgrimes * The implementation was written so as to conform with Netscapes SSL.
81541Srgrimes *
91541Srgrimes * This library is free for commercial and non-commercial use as long as
101541Srgrimes * the following conditions are aheared to.  The following conditions
111541Srgrimes * apply to all code found in this distribution, be it the RC4, RSA,
121541Srgrimes * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
131541Srgrimes * included with this distribution is covered by the same copyright terms
141541Srgrimes * except that the holder is Tim Hudson (tjh@cryptsoft.com).
151541Srgrimes *
161541Srgrimes * Copyright remains Eric Young's, and as such any Copyright notices in
171541Srgrimes * the code are not to be removed.
181541Srgrimes * If this package is used in a product, Eric Young should be given attribution
191541Srgrimes * as the author of the parts of the library used.
201541Srgrimes * This can be in the form of a textual message at program startup or
211541Srgrimes * in documentation (online or textual) provided with the package.
221541Srgrimes *
231541Srgrimes * Redistribution and use in source and binary forms, with or without
241541Srgrimes * modification, are permitted provided that the following conditions
251541Srgrimes * are met:
261541Srgrimes * 1. Redistributions of source code must retain the copyright
271541Srgrimes *    notice, this list of conditions and the following disclaimer.
281541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
291541Srgrimes *    notice, this list of conditions and the following disclaimer in the
301541Srgrimes *    documentation and/or other materials provided with the distribution.
311541Srgrimes * 3. All advertising materials mentioning features or use of this software
321541Srgrimes *    must display the following acknowledgement:
331541Srgrimes *    "This product includes cryptographic software written by
3412171Sphk *     Eric Young (eay@cryptsoft.com)"
351541Srgrimes *    The word 'cryptographic' can be left out if the rouines from the library
361541Srgrimes *    being used are not cryptographic related :-).
371541Srgrimes * 4. If you include any Windows specific code (or a derivative thereof) from
381541Srgrimes *    the apps directory (application code) you must include an acknowledgement:
391541Srgrimes *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
401541Srgrimes *
411541Srgrimes * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
421541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
431541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
441549Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
453308Sphk * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
461541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
474959Sphk * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
484959Sphk * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
494959Sphk * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
504959Sphk * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
514959Sphk * SUCH DAMAGE.
528876Srgrimes *
534959Sphk * The licence and distribution terms for any publically available version or
544959Sphk * derivative of this code cannot be changed.  i.e. this code cannot simply be
554959Sphk * copied and put under another distribution licence
564959Sphk * [including the GNU Public Licence.]
574959Sphk */
581541Srgrimes
591541Srgrimes#include <stdio.h>
601541Srgrimes#include "cryptlib.h"
611541Srgrimes#include <openssl/evp.h>
621549Srgrimes#include <openssl/objects.h>
631541Srgrimes#include <openssl/x509.h>
641541Srgrimes
651541Srgrimes#ifndef NO_SHA
661541Srgrimesstatic EVP_MD dsa_md=
671541Srgrimes	{
681541Srgrimes	NID_dsaWithSHA,
691541Srgrimes	NID_dsaWithSHA,
703098Sphk	SHA_DIGEST_LENGTH,
711541Srgrimes	SHA1_Init,
724959Sphk	SHA1_Update,
734959Sphk	SHA1_Final,
744959Sphk	EVP_PKEY_DSA_method,
754959Sphk	SHA_CBLOCK,
764959Sphk	sizeof(EVP_MD *)+sizeof(SHA_CTX),
774959Sphk	};
784959Sphk
794959SphkEVP_MD *EVP_dss(void)
801541Srgrimes	{
811541Srgrimes	return(&dsa_md);
821541Srgrimes	}
831541Srgrimes#endif
841541Srgrimes