1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
23 */
24
25#ifndef _SYS_CRYPTO_FIPS_H
26#define	_SYS_CRYPTO_FIPS_H
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32#ifdef  _KERNEL
33#include <sys/elf.h>
34#include <sys/modctl.h>
35#include <sys/kobj.h>
36#include <sys/kmem.h>
37#include <sys/sha1.h>
38#include <sys/ddi.h>
39#else
40#include <ctype.h>
41#include <unistd.h>
42#include <sys/types.h>
43#include <fcntl.h>
44#include <stdio.h>
45#include <libelf.h>
46#include <gelf.h>
47#include <stdlib.h>
48#include <string.h>
49#include <sha1.h>
50#include <sys/elf_SPARC.h>
51#endif
52
53
54#define	FAILURE -1
55#define	SUCCESS 0
56
57#ifdef  _KERNEL
58extern int	fips_calc_checksum(struct _buf *, Elf64_Ehdr *, char *);
59extern int	fips_check_module(char *modname, void *_initaddr);
60#else
61extern int	fips_read_file(int, char *, int, int);
62extern int	fips_calc_checksum(int, Elf64_Ehdr *, char *);
63#endif
64
65
66#ifdef __cplusplus
67}
68#endif
69
70#endif /* _SYS_CRYPTO_FIPS_H */
71