Home
last modified time | relevance | path

Searched refs:mech (Results 1 – 25 of 198) sorted by relevance

12345678

/illumos-gate/usr/src/lib/libgss/
H A Dg_glue.c310 gss_mechanism mech; local
312 mech = gssint_get_mechanism (mech_type);
313 if (mech) {
314 if (mech->gss_import_name) {
315 status = mech->gss_import_name (
316 mech->context, /* SUNW17PACresync */
322 map_error(minor_status, mech);
340 gss_mechanism mech; local
350 mech = gssint_get_mechanism(mech_type);
351 if (!mech)
[all …]
H A Dg_inquire_context.c81 gss_mechanism mech; in gss_inquire_context() local
99 mech = __gss_get_mechanism(ctx->mech_type); in gss_inquire_context()
101 if (!mech || !mech->gss_inquire_context || !mech->gss_display_name || in gss_inquire_context()
102 !mech->gss_release_name) { in gss_inquire_context()
106 status = mech->gss_inquire_context( in gss_inquire_context()
107 mech->context, in gss_inquire_context()
119 map_error(minor_status, mech); in gss_inquire_context()
125 status = __gss_convert_name_to_union_name(minor_status, mech, in gss_inquire_context()
129 mech->gss_release_name(mech->context, in gss_inquire_context()
136 status = __gss_convert_name_to_union_name(minor_status, mech, in gss_inquire_context()
[all …]
H A Dg_seal.c88 gss_mechanism mech; local
103 mech = __gss_get_mechanism(ctx->mech_type);
105 if (mech) {
106 if (mech->gss_seal) {
107 status = mech->gss_seal(
108 mech->context,
117 map_error(minor_status, mech);
165 gss_mechanism mech; local
184 mech = __gss_get_mechanism(ctx->mech_type);
186 if (!mech)
[all …]
H A Dg_inquire_cred.c54 gss_mechanism mech; local
82 if ((mech = __gss_get_mechanism(GSS_C_NULL_OID)) == NULL)
85 if (!mech->gss_inquire_cred)
88 status = mech->gss_inquire_cred(mech->context, minor_status,
95 map_error(minor_status, mech);
104 &temp_minor_status, mech,
108 map_error(minor_status, mech);
227 gss_mechanism mech; local
240 mech = __gss_get_mechanism(mech_type);
241 if (!mech)
[all …]
H A Dg_compare_name.c75 gss_mechanism mech = NULL; local
99 mech = __gss_get_mechanism(union_name1->mech_type);
100 if (!mech)
102 if (!mech->gss_compare_name)
119 if (!mech)
121 if (!mech->gss_compare_name)
123 major_status = mech->gss_compare_name(mech->context,
129 map_error(minor_status, mech);
200 if (!mech)
202 if (!mech->gss_compare_name)
[all …]
H A Dg_utils.c146 qop_num_pairs[qop_num_pair_cnt].mech = strdup(name); in __gss_read_qop_file()
147 if (qop_num_pairs[qop_num_pair_cnt].mech == NULL) { in __gss_read_qop_file()
164 char *mech, in __gss_qop_to_num() argument
184 if ((strcasecmp(mech, qop_num_pairs[i].mech) == 0) && in __gss_qop_to_num()
196 char *mech, in __gss_num_to_qop() argument
213 if (mech == NULL) in __gss_num_to_qop()
220 if ((strcasecmp(mech, qop_num_pairs[i].mech) == 0) && in __gss_num_to_qop()
235 char *mech, in __gss_get_mech_info() argument
246 if (!mech) in __gss_get_mech_info()
253 if (strcmp(mech, qop_num_pairs[i].mech) == 0) { in __gss_get_mech_info()
[all …]
H A Dg_store_cred.c100 gss_mechanism mech; local
125 mech = __gss_get_mechanism(desired_mech);
126 if (mech == NULL)
129 if (mech->gss_store_cred == NULL)
136 major_status = mech->gss_store_cred(mech->context,
146 map_error(minor_status, mech);
157 mech = __gss_get_mechanism(dmech);
158 if (mech == NULL)
161 if (mech->gss_store_cred == NULL)
168 major_status = mech->gss_store_cred(mech->context,
[all …]
/illumos-gate/usr/src/lib/gss_mechs/mech_krb5/mech/
H A Dutil_errmap.c50 gss_OID_desc mech; member
72 if (m1.mech.length < m2.mech.length) in mecherror_cmp()
74 if (m1.mech.length > m2.mech.length) in mecherror_cmp()
76 if (m1.mech.length == 0) in mecherror_cmp()
78 return memcmp(m1.mech.elements, m2.mech.elements, m1.mech.length); in mecherror_cmp()
91 dest->mech.elements = malloc(src.mech.length); in mecherror_copy()
92 if (dest->mech.elements == NULL) { in mecherror_copy()
93 if (src.mech.length) in mecherror_copy()
98 memcpy(dest->mech.elements, src.mech.elements, src.mech.length); in mecherror_copy()
119 if (value.mech.length == 0) { in mecherror_print()
[all …]
/illumos-gate/usr/src/lib/smbsrv/libfksmbsrv/common/
H A Dfksmb_sign_pkcs.c35 find_mech(smb_crypto_mech_t *mech, ulong_t mid) in find_mech() argument
48 mech->mechanism = mid; in find_mech()
49 mech->pParameter = NULL; in find_mech()
50 mech->ulParameterLen = 0; in find_mech()
63 smb_md5_getmech(smb_crypto_mech_t *mech) in smb_md5_getmech() argument
65 return (find_mech(mech, CKM_MD5)); in smb_md5_getmech()
72 smb_md5_init(smb_sign_ctx_t *ctxp, smb_crypto_mech_t *mech) in smb_md5_init() argument
76 rv = SUNW_C_GetMechSession(mech->mechanism, ctxp); in smb_md5_init()
80 rv = C_DigestInit(*ctxp, mech); in smb_md5_init()
124 smb2_hmac_getmech(smb_crypto_mech_t *mech) in smb2_hmac_getmech() argument
[all …]
H A Dfksmb_preauth_pkcs.c26 getmech_sha512(smb_crypto_mech_t *mech) in getmech_sha512() argument
40 mech->mechanism = mid; in getmech_sha512()
41 mech->pParameter = NULL; in getmech_sha512()
42 mech->ulParameterLen = 0; in getmech_sha512()
52 smb_crypto_mech_t *mech; in smb31_preauth_init_mech() local
60 mech = kmem_zalloc(sizeof (*mech), KM_SLEEP); in smb31_preauth_init_mech()
61 rc = getmech_sha512(mech); in smb31_preauth_init_mech()
63 kmem_free(mech, sizeof (*mech)); in smb31_preauth_init_mech()
66 s->preauth_mech = mech; in smb31_preauth_init_mech()
72 smb_crypto_mech_t *mech; in smb31_preauth_fini() local
[all …]
H A Dfksmb_encrypt_pkcs.c62 smb3_aes_ccm_getmech(smb_crypto_mech_t *mech) in smb3_aes_ccm_getmech() argument
70 mech->mechanism = CKM_AES_CCM; in smb3_aes_ccm_getmech()
75 smb3_aes_gcm_getmech(smb_crypto_mech_t *mech) in smb3_aes_gcm_getmech() argument
83 mech->mechanism = CKM_AES_GCM; in smb3_aes_gcm_getmech()
104 ctx->mech.pParameter = (caddr_t)&ctx->param.ccm; in smb3_crypto_init_ccm_param()
105 ctx->mech.ulParameterLen = sizeof (ctx->param.ccm); in smb3_crypto_init_ccm_param()
123 ctx->mech.pParameter = (caddr_t)&ctx->param.gcm; in smb3_crypto_init_gcm_param()
124 ctx->mech.ulParameterLen = sizeof (ctx->param.gcm); in smb3_crypto_init_gcm_param()
138 CK_MECHANISM *mech = &ctxp->mech; in smb3_encrypt_init() local
141 rv = SUNW_C_GetMechSession(mech->mechanism, &ctxp->ctx); in smb3_encrypt_init()
[all …]
/illumos-gate/usr/src/lib/smbclnt/libfknsmb/common/
H A Dfksmb_sign_pkcs.c41 find_mech(smb_crypto_mech_t *mech, ulong_t mid) in find_mech() argument
54 mech->mechanism = mid; in find_mech()
55 mech->pParameter = NULL; in find_mech()
56 mech->ulParameterLen = 0; in find_mech()
69 nsmb_md5_getmech(smb_crypto_mech_t *mech) in nsmb_md5_getmech() argument
71 return (find_mech(mech, CKM_MD5)); in nsmb_md5_getmech()
78 nsmb_md5_init(smb_sign_ctx_t *ctxp, smb_crypto_mech_t *mech) in nsmb_md5_init() argument
82 rv = SUNW_C_GetMechSession(mech->mechanism, ctxp); in nsmb_md5_init()
86 rv = C_DigestInit(*ctxp, mech); in nsmb_md5_init()
130 nsmb_hmac_getmech(smb_crypto_mech_t *mech) in nsmb_hmac_getmech() argument
[all …]
H A Dfksmb_crypt_pkcs.c67 nsmb_aes_ccm_getmech(smb_crypto_mech_t *mech) in nsmb_aes_ccm_getmech() argument
75 mech->mechanism = CKM_AES_CCM; in nsmb_aes_ccm_getmech()
80 nsmb_aes_gcm_getmech(smb_crypto_mech_t *mech) in nsmb_aes_gcm_getmech() argument
88 mech->mechanism = CKM_AES_GCM; in nsmb_aes_gcm_getmech()
109 ctx->mech.pParameter = (caddr_t)&ctx->param.ccm; in nsmb_crypto_init_ccm_param()
110 ctx->mech.ulParameterLen = sizeof (ctx->param.ccm); in nsmb_crypto_init_ccm_param()
128 ctx->mech.pParameter = (caddr_t)&ctx->param.gcm; in nsmb_crypto_init_gcm_param()
129 ctx->mech.ulParameterLen = sizeof (ctx->param.gcm); in nsmb_crypto_init_gcm_param()
143 CK_MECHANISM *mech = &ctxp->mech; in nsmb_encrypt_init() local
146 rv = SUNW_C_GetMechSession(mech->mechanism, &ctxp->ctx); in nsmb_encrypt_init()
[all …]
/illumos-gate/usr/src/lib/pkcs11/pkcs11_tpm/common/
H A Dencr_mgr.c34 CK_MECHANISM * mech, in encr_mgr_init() argument
45 if (! sess || ! ctx || ! mech) { in encr_mgr_init()
88 switch (mech->mechanism) { in encr_mgr_init()
91 if (mech->ulParameterLen != 0) { in encr_mgr_init()
114 if (mech->ulParameterLen > 0) { in encr_mgr_init()
115 ptr = (CK_BYTE *)malloc(mech->ulParameterLen); in encr_mgr_init()
119 (void) memcpy(ptr, mech->pParameter, mech->ulParameterLen); in encr_mgr_init()
123 ctx->mech.ulParameterLen = mech->ulParameterLen; in encr_mgr_init()
124 ctx->mech.mechanism = mech->mechanism; in encr_mgr_init()
125 ctx->mech.pParameter = ptr; in encr_mgr_init()
[all …]
H A Ddecr_mgr.c36 CK_MECHANISM *mech, in decr_mgr_init() argument
88 switch (mech->mechanism) { in decr_mgr_init()
91 if (mech->ulParameterLen != 0) in decr_mgr_init()
115 if (mech->ulParameterLen > 0) { in decr_mgr_init()
116 ptr = (CK_BYTE *)malloc(mech->ulParameterLen); in decr_mgr_init()
120 (void) memcpy(ptr, mech->pParameter, mech->ulParameterLen); in decr_mgr_init()
124 ctx->mech.ulParameterLen = mech->ulParameterLen; in decr_mgr_init()
125 ctx->mech.mechanism = mech->mechanism; in decr_mgr_init()
126 ctx->mech.pParameter = ptr; in decr_mgr_init()
140 ctx->mech.ulParameterLen = 0; in decr_mgr_cleanup()
[all …]
H A Dsign_mgr.c33 CK_MECHANISM * mech, in sign_mgr_init() argument
66 switch (mech->mechanism) { in sign_mgr_init()
139 if (mech->ulParameterLen != 0) { in sign_mgr_init()
164 (CK_MAC_GENERAL_PARAMS *)mech->pParameter; in sign_mgr_init()
166 if (mech->ulParameterLen != in sign_mgr_init()
171 if ((mech->mechanism == CKM_MD5_HMAC_GENERAL) && in sign_mgr_init()
175 if ((mech->mechanism == CKM_SHA_1_HMAC_GENERAL) && in sign_mgr_init()
200 if (mech->ulParameterLen > 0 && mech->pParameter == NULL) in sign_mgr_init()
203 if (mech->ulParameterLen > 0) { in sign_mgr_init()
204 ptr = (CK_BYTE *)malloc(mech->ulParameterLen); in sign_mgr_init()
[all …]
H A Dsess_mgr.c580 if (sess->encr_ctx.mech.pParameter) in session_mgr_close_session()
581 free(sess->encr_ctx.mech.pParameter); in session_mgr_close_session()
586 if (sess->decr_ctx.mech.pParameter) in session_mgr_close_session()
587 free(sess->decr_ctx.mech.pParameter); in session_mgr_close_session()
592 if (sess->digest_ctx.mech.pParameter) in session_mgr_close_session()
593 free(sess->digest_ctx.mech.pParameter); in session_mgr_close_session()
598 if (sess->sign_ctx.mech.pParameter) in session_mgr_close_session()
599 free(sess->sign_ctx.mech.pParameter); in session_mgr_close_session()
604 if (sess->verify_ctx.mech.pParameter) in session_mgr_close_session()
605 free(sess->verify_ctx.mech.pParameter); in session_mgr_close_session()
[all …]
H A Dverify_mgr.c33 CK_MECHANISM * mech, in verify_mgr_init() argument
70 switch (mech->mechanism) { in verify_mgr_init()
161 (CK_MAC_GENERAL_PARAMS *)mech->pParameter; in verify_mgr_init()
163 if (mech->ulParameterLen != in verify_mgr_init()
167 if ((mech->mechanism == CKM_MD5_HMAC_GENERAL) && in verify_mgr_init()
171 if ((mech->mechanism == CKM_SHA_1_HMAC_GENERAL) && in verify_mgr_init()
197 ctx->mech.ulParameterLen = mech->ulParameterLen; in verify_mgr_init()
198 ctx->mech.mechanism = mech->mechanism; in verify_mgr_init()
199 ctx->mech.pParameter = mech->pParameter; in verify_mgr_init()
214 ctx->mech.ulParameterLen = 0; in verify_mgr_cleanup()
[all …]
H A Ddig_mgr.c302 CK_MECHANISM *mech) in digest_mgr_init() argument
311 switch (mech->mechanism) { in digest_mgr_init()
339 ctx->mech.ulParameterLen = mech->ulParameterLen; in digest_mgr_init()
340 ctx->mech.mechanism = mech->mechanism; in digest_mgr_init()
341 ctx->mech.pParameter = mech->pParameter; in digest_mgr_init()
354 if (ctx->mech.mechanism == CKM_MD5) { in digest_mgr_cleanup()
357 } else if (ctx->mech.mechanism == CKM_SHA_1) { in digest_mgr_cleanup()
361 ctx->mech.ulParameterLen = 0; in digest_mgr_cleanup()
362 ctx->mech.pParameter = NULL; in digest_mgr_cleanup()
363 ctx->mech.mechanism = 0; in digest_mgr_cleanup()
[all …]
/illumos-gate/usr/src/test/crypto-tests/tests/common/
H A Dcryptotest_pkcs.c41 CK_MECHANISM_TYPE mech; member
113 rv = pkcs11_str2mech(op->mechname, &op->mech); in get_mech_info()
128 rv = SUNW_C_GetMechSession(op->mech, &op->hsession); in get_hsession_by_mech()
133 op->mech); in get_hsession_by_mech()
145 CK_MECHANISM mech; in sign_init() local
148 mech.mechanism = op->mech; in sign_init()
149 mech.pParameter = NULL; in sign_init()
150 mech.ulParameterLen = 0; in sign_init()
152 rv = SUNW_C_KeyToObject(op->hsession, op->mech, in sign_init()
158 rv = C_SignInit(op->hsession, &mech, op->keyt); in sign_init()
[all …]
/illumos-gate/usr/src/uts/common/fs/smbsrv/
H A Dsmb31_preauth.c35 smb3_sha512_getmech(smb_crypto_mech_t *mech) in smb3_sha512_getmech() argument
44 mech->cm_type = t; in smb3_sha512_getmech()
54 smb_crypto_mech_t *mech; in smb31_preauth_init_mech() local
62 mech = kmem_zalloc(sizeof (*mech), KM_SLEEP); in smb31_preauth_init_mech()
63 rc = smb3_sha512_getmech(mech); in smb31_preauth_init_mech()
65 kmem_free(mech, sizeof (*mech)); in smb31_preauth_init_mech()
68 s->preauth_mech = mech; in smb31_preauth_init_mech()
74 smb_crypto_mech_t *mech; in smb31_preauth_fini() local
76 if ((mech = s->preauth_mech) != NULL) { in smb31_preauth_fini()
77 kmem_free(mech, sizeof (*mech)); in smb31_preauth_fini()
[all …]
H A Dsmb_sign_kcf.c36 find_mech(smb_crypto_mech_t *mech, const char *name) in find_mech() argument
45 mech->cm_type = t; in find_mech()
55 smb_md5_getmech(smb_crypto_mech_t *mech) in smb_md5_getmech() argument
57 return (find_mech(mech, SUN_CKM_MD5)); in smb_md5_getmech()
64 smb_md5_init(smb_sign_ctx_t *ctxp, smb_crypto_mech_t *mech) in smb_md5_init() argument
68 rv = crypto_digest_init(mech, ctxp, NULL); in smb_md5_init()
124 smb2_hmac_getmech(smb_crypto_mech_t *mech) in smb2_hmac_getmech() argument
126 return (find_mech(mech, SUN_CKM_SHA256_HMAC)); in smb2_hmac_getmech()
133 smb2_hmac_init(smb_sign_ctx_t *ctxp, smb_crypto_mech_t *mech, in smb2_hmac_init() argument
144 rv = crypto_mac_init(mech, &ckey, NULL, ctxp, NULL); in smb2_hmac_init()
[all …]
/illumos-gate/usr/src/uts/common/crypto/api/
H A Dkcf_keys.c41 crypto_mechanism_t *mech, crypto_object_attribute_t *attrs, uint_t count, in crypto_key_generate() argument
52 rv = kcf_get_hardware_provider(mech->cm_type, NULL, in crypto_key_generate()
62 mech, attrs, count, handle, KCF_SWFP_RHNDL(crq)); in crypto_key_generate()
66 mech, attrs, count, handle, NULL, 0, NULL, NULL, NULL, 0); in crypto_key_generate()
78 crypto_mechanism_t *mech, crypto_object_attribute_t *pub_attrs, in crypto_key_generate_pair() argument
91 rv = kcf_get_hardware_provider(mech->cm_type, NULL, in crypto_key_generate_pair()
100 rv = KCF_PROV_KEY_GENERATE_PAIR(real_provider, sid, mech, in crypto_key_generate_pair()
106 sid, mech, pub_attrs, pub_count, pub_handle, pri_attrs, in crypto_key_generate_pair()
119 crypto_mechanism_t *mech, crypto_key_t *wrapping_key, in crypto_key_wrap() argument
131 rv = kcf_get_hardware_provider(mech->cm_type, wrapping_key, in crypto_key_wrap()
[all …]
H A Dkcf_cipher.c106 crypto_mechanism_t *mech, crypto_key_t *key, in crypto_cipher_init_prov() argument
120 error = kcf_get_hardware_provider(mech->cm_type, key, in crypto_cipher_init_prov()
124 error = kcf_get_hardware_provider(mech->cm_type, key, in crypto_cipher_init_prov()
144 lmech = *mech; in crypto_cipher_init_prov()
145 KCF_SET_PROVIDER_MECHNUM(mech->cm_type, real_provider, &lmech); in crypto_cipher_init_prov()
164 KCF_CAN_SHARE_OPSTATE(pd, mech->cm_type)) { in crypto_cipher_init_prov()
169 if ((kcf_get_sw_prov(mech->cm_type, &tpd, &tctxp->kc_mech, in crypto_cipher_init_prov()
173 sinfo = &(KCF_TO_PROV_MECHINFO(tpd, mech->cm_type)); in crypto_cipher_init_prov()
199 mech, key, NULL, NULL, tmpl); in crypto_cipher_init_prov()
203 mech, key, NULL, NULL, tmpl); in crypto_cipher_init_prov()
[all …]
/illumos-gate/usr/src/uts/common/gssapi/mechs/krb5/mech/
H A Dutil_token.c147 unsigned int g_token_size(mech, body_size) in g_token_size() argument
148 const gss_OID_desc * mech; in g_token_size()
152 body_size += 4 + (int) mech->length; /* NEED overflow check */
159 void g_make_token_header(mech, body_size, buf, tok_type) in g_make_token_header() argument
160 const gss_OID_desc * mech; in g_make_token_header()
167 (tok_type == -1) ? 2 : (int) (4 + mech->length + body_size));
169 *(*buf)++ = (unsigned char) mech->length;
170 TWRITE_STR(*buf, mech->elements, mech->length);
186 gss_int32 g_verify_token_header(mech, body_size, buf_in, tok_type, toksize_in, in g_verify_token_header() argument
188 const gss_OID_desc * mech; in g_verify_token_header()
[all …]

12345678