summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/crypto/io/sha2_mod.c
diff options
context:
space:
mode:
authorHai-May Chao <Hai-May.Chao@Sun.COM>2009-09-11 09:04:22 -0700
committerHai-May Chao <Hai-May.Chao@Sun.COM>2009-09-11 09:04:22 -0700
commitb5a2d8455dfa3190fc977c4bec53e91c99012767 (patch)
treebff1e4f897b4291273be1f3f4c90125be60353b7 /usr/src/uts/common/crypto/io/sha2_mod.c
parent44da779fd55c337eb9877e490e494037fc1ddf06 (diff)
downloadillumos-gate-b5a2d8455dfa3190fc977c4bec53e91c99012767.tar.gz
PSARC 2009/347 cryptoadm(1M) enhancement for FIPS-140 mode
6787364 Administration and policy configuration changes to support FIPS 140-2 6867384 Solaris Crypto Framework needs to implement self tests for FIPS 140-2 compliance
Diffstat (limited to 'usr/src/uts/common/crypto/io/sha2_mod.c')
-rw-r--r--usr/src/uts/common/crypto/io/sha2_mod.c34
1 files changed, 12 insertions, 22 deletions
diff --git a/usr/src/uts/common/crypto/io/sha2_mod.c b/usr/src/uts/common/crypto/io/sha2_mod.c
index a6cff46faa..13e04719cf 100644
--- a/usr/src/uts/common/crypto/io/sha2_mod.c
+++ b/usr/src/uts/common/crypto/io/sha2_mod.c
@@ -33,6 +33,7 @@
#include <sys/sysmacros.h>
#define _SHA2_IMPL
#include <sys/sha2.h>
+#include <sha2/sha2_impl.h>
/*
* The sha2 module is created with two modlinkages:
@@ -58,28 +59,6 @@ static struct modlinkage modlinkage = {
};
/*
- * CSPI information (entry points, provider info, etc.)
- */
-
-/*
- * Context for SHA2 mechanism.
- */
-typedef struct sha2_ctx {
- sha2_mech_type_t sc_mech_type; /* type of context */
- SHA2_CTX sc_sha2_ctx; /* SHA2 context */
-} sha2_ctx_t;
-
-/*
- * Context for SHA2 HMAC and HMAC GENERAL mechanisms.
- */
-typedef struct sha2_hmac_ctx {
- sha2_mech_type_t hc_mech_type; /* type of context */
- uint32_t hc_digest_len; /* digest len in bytes */
- SHA2_CTX hc_icontext; /* inner SHA2 context */
- SHA2_CTX hc_ocontext; /* outer SHA2 context */
-} sha2_hmac_ctx_t;
-
-/*
* Macros to access the SHA2 or SHA2-HMAC contexts from a context passed
* by KCF to one of the entry points.
*/
@@ -1631,3 +1610,14 @@ sha2_free_context(crypto_ctx_t *ctx)
return (CRYPTO_SUCCESS);
}
+
+/*
+ * SHA-2 Power-Up Self-Test
+ */
+void
+sha2_POST(int *rc)
+{
+
+ *rc = fips_sha2_post();
+
+}