Home
last modified time | relevance | path

Searched refs:ctx (Results 1 – 25 of 1181) sorted by relevance

12345678910>>...48

/dragonfly/contrib/libarchive/libarchive/
HDarchive_digest.c52 win_crypto_init(Digest_CTX *ctx, ALG_ID algId) in win_crypto_init() argument
55 ctx->valid = 0; in win_crypto_init()
56 if (!CryptAcquireContext(&ctx->cryptProv, NULL, NULL, in win_crypto_init()
60 if (!CryptAcquireContext(&ctx->cryptProv, NULL, NULL, in win_crypto_init()
65 if (!CryptCreateHash(ctx->cryptProv, algId, 0, 0, &ctx->hash)) { in win_crypto_init()
66 CryptReleaseContext(ctx->cryptProv, 0); in win_crypto_init()
70 ctx->valid = 1; in win_crypto_init()
78 win_crypto_Update(Digest_CTX *ctx, const unsigned char *buf, size_t len) in win_crypto_Update() argument
81 if (!ctx->valid) in win_crypto_Update()
84 CryptHashData(ctx->hash, in win_crypto_Update()
[all …]
HDarchive_cryptor.c95 mbedtls_md_context_t ctx; in pbkdf2_sha1() local
99 mbedtls_md_init(&ctx); in pbkdf2_sha1()
102 mbedtls_md_free(&ctx); in pbkdf2_sha1()
105 ret = mbedtls_md_setup(&ctx, info, 1); in pbkdf2_sha1()
107 mbedtls_md_free(&ctx); in pbkdf2_sha1()
110 ret = mbedtls_pkcs5_pbkdf2_hmac(&ctx, (const unsigned char *)pw, in pbkdf2_sha1()
113 mbedtls_md_free(&ctx); in pbkdf2_sha1()
165 aes_ctr_init(archive_crypto_ctx *ctx, const uint8_t *key, size_t key_len) in aes_ctr_init() argument
169 ctx->key_len = key_len; in aes_ctr_init()
170 memcpy(ctx->key, key, key_len); in aes_ctr_init()
[all …]
HDarchive_hmac.c51 __hmac_sha1_init(archive_hmac_sha1_ctx *ctx, const uint8_t *key, size_t key_len) in __hmac_sha1_init() argument
53 CCHmacInit(ctx, kCCHmacAlgSHA1, key, key_len); in __hmac_sha1_init()
58 __hmac_sha1_update(archive_hmac_sha1_ctx *ctx, const uint8_t *data, in __hmac_sha1_update() argument
61 CCHmacUpdate(ctx, data, data_len); in __hmac_sha1_update()
65 __hmac_sha1_final(archive_hmac_sha1_ctx *ctx, uint8_t *out, size_t *out_len) in __hmac_sha1_final() argument
67 CCHmacFinal(ctx, out); in __hmac_sha1_final()
72 __hmac_sha1_cleanup(archive_hmac_sha1_ctx *ctx) in __hmac_sha1_cleanup() argument
74 memset(ctx, 0, sizeof(*ctx)); in __hmac_sha1_cleanup()
84 __hmac_sha1_init(archive_hmac_sha1_ctx *ctx, const uint8_t *key, size_t key_len) in __hmac_sha1_init() argument
96 ctx->hAlg = NULL; in __hmac_sha1_init()
[all …]
/dragonfly/contrib/zstd/lib/common/
HDpool.c68 POOL_ctx* const ctx = (POOL_ctx*)opaque; in POOL_thread() local
69 if (!ctx) { return NULL; } in POOL_thread()
72 ZSTD_pthread_mutex_lock(&ctx->queueMutex); in POOL_thread()
74 while ( ctx->queueEmpty in POOL_thread()
75 || (ctx->numThreadsBusy >= ctx->threadLimit) ) { in POOL_thread()
76 if (ctx->shutdown) { in POOL_thread()
80 ZSTD_pthread_mutex_unlock(&ctx->queueMutex); in POOL_thread()
83 ZSTD_pthread_cond_wait(&ctx->queuePopCond, &ctx->queueMutex); in POOL_thread()
86 { POOL_job const job = ctx->queue[ctx->queueHead]; in POOL_thread()
87 ctx->queueHead = (ctx->queueHead + 1) % ctx->queueSize; in POOL_thread()
[all …]
/dragonfly/sys/dev/drm/amd/display/dc/i2caux/
HDaux_engine.c59 engine->base.ctx->logger
120 struct read_command_context *ctx) in process_read_reply() argument
122 engine->funcs->process_channel_reply(engine, &ctx->reply); in process_read_reply()
124 switch (ctx->reply.status) { in process_read_reply()
126 ctx->defer_retry_aux = 0; in process_read_reply()
127 if (ctx->returned_byte > ctx->current_read_length) { in process_read_reply()
128 ctx->status = in process_read_reply()
130 ctx->operation_succeeded = false; in process_read_reply()
131 } else if (ctx->returned_byte < ctx->current_read_length) { in process_read_reply()
132 ctx->current_read_length -= ctx->returned_byte; in process_read_reply()
[all …]
/dragonfly/crypto/libressl/crypto/evp/
HDbio_b64.c118 BIO_B64_CTX *ctx; in b64_new() local
120 ctx = malloc(sizeof(BIO_B64_CTX)); in b64_new()
121 if (ctx == NULL) in b64_new()
124 ctx->buf_len = 0; in b64_new()
125 ctx->tmp_len = 0; in b64_new()
126 ctx->tmp_nl = 0; in b64_new()
127 ctx->buf_off = 0; in b64_new()
128 ctx->cont = 1; in b64_new()
129 ctx->start = 1; in b64_new()
130 ctx->encode = 0; in b64_new()
[all …]
HDpmeth_fn.c68 #define M_check_autoarg(ctx, arg, arglen, err) \ argument
69 if (ctx->pmeth->flags & EVP_PKEY_FLAG_AUTOARGLEN) \
71 size_t pksize = (size_t)EVP_PKEY_size(ctx->pkey); \
85 EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx) in EVP_PKEY_sign_init() argument
89 if (!ctx || !ctx->pmeth || !ctx->pmeth->sign) { in EVP_PKEY_sign_init()
93 ctx->operation = EVP_PKEY_OP_SIGN; in EVP_PKEY_sign_init()
94 if (!ctx->pmeth->sign_init) in EVP_PKEY_sign_init()
96 ret = ctx->pmeth->sign_init(ctx); in EVP_PKEY_sign_init()
98 ctx->operation = EVP_PKEY_OP_UNDEFINED; in EVP_PKEY_sign_init()
103 EVP_PKEY_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, in EVP_PKEY_sign() argument
[all …]
HDevp_enc.c78 EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, in EVP_CipherInit() argument
82 EVP_CIPHER_CTX_init(ctx); in EVP_CipherInit()
83 return EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, enc); in EVP_CipherInit()
87 EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *impl, in EVP_CipherInit_ex() argument
91 enc = ctx->encrypt; in EVP_CipherInit_ex()
95 ctx->encrypt = enc; in EVP_CipherInit_ex()
102 if (ctx->engine && ctx->cipher && in EVP_CipherInit_ex()
103 (!cipher || (cipher && (cipher->nid == ctx->cipher->nid)))) in EVP_CipherInit_ex()
110 if (ctx->cipher) { in EVP_CipherInit_ex()
111 unsigned long flags = ctx->flags; in EVP_CipherInit_ex()
[all …]
HDdigest.c128 EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type) in EVP_DigestInit() argument
130 EVP_MD_CTX_init(ctx); in EVP_DigestInit()
131 return EVP_DigestInit_ex(ctx, type, NULL); in EVP_DigestInit()
135 EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl) in EVP_DigestInit_ex() argument
137 EVP_MD_CTX_clear_flags(ctx, EVP_MD_CTX_FLAG_CLEANED); in EVP_DigestInit_ex()
144 if (ctx->engine && ctx->digest && (!type || in EVP_DigestInit_ex()
145 (type && (type->type == ctx->digest->type)))) in EVP_DigestInit_ex()
151 ENGINE_finish(ctx->engine); in EVP_DigestInit_ex()
174 ctx->engine = impl; in EVP_DigestInit_ex()
176 ctx->engine = NULL; in EVP_DigestInit_ex()
[all …]
HDbio_enc.c113 BIO_ENC_CTX *ctx; in enc_new() local
115 ctx = malloc(sizeof(BIO_ENC_CTX)); in enc_new()
116 if (ctx == NULL) in enc_new()
118 EVP_CIPHER_CTX_init(&ctx->cipher); in enc_new()
120 ctx->buf_len = 0; in enc_new()
121 ctx->buf_off = 0; in enc_new()
122 ctx->cont = 1; in enc_new()
123 ctx->finished = 0; in enc_new()
124 ctx->ok = 1; in enc_new()
127 bi->ptr = (char *)ctx; in enc_new()
[all …]
/dragonfly/sys/crypto/siphash/
HDsiphash.c50 static void SipRounds(SIPHASH_CTX *ctx, int final);
53 SipHash_InitX(SIPHASH_CTX *ctx, int rc, int rf) in SipHash_InitX() argument
56 ctx->v[0] = 0x736f6d6570736575ull; in SipHash_InitX()
57 ctx->v[1] = 0x646f72616e646f6dull; in SipHash_InitX()
58 ctx->v[2] = 0x6c7967656e657261ull; in SipHash_InitX()
59 ctx->v[3] = 0x7465646279746573ull; in SipHash_InitX()
60 ctx->buf.b64 = 0; in SipHash_InitX()
61 ctx->bytes = 0; in SipHash_InitX()
62 ctx->buflen = 0; in SipHash_InitX()
63 ctx->rounds_compr = rc; in SipHash_InitX()
[all …]
/dragonfly/crypto/libressl/crypto/x509/
HDx509_verify.c33 static int x509_verify_cert_valid(struct x509_verify_ctx *ctx, X509 *cert,
35 static int x509_verify_cert_hostname(struct x509_verify_ctx *ctx, X509 *cert,
37 static void x509_verify_build_chains(struct x509_verify_ctx *ctx, X509 *cert,
39 static int x509_verify_cert_error(struct x509_verify_ctx *ctx, X509 *cert,
216 x509_verify_ctx_reset(struct x509_verify_ctx *ctx) in x509_verify_ctx_reset() argument
220 for (i = 0; i < ctx->chains_count; i++) in x509_verify_ctx_reset()
221 x509_verify_chain_free(ctx->chains[i]); in x509_verify_ctx_reset()
222 sk_X509_pop_free(ctx->saved_error_chain, X509_free); in x509_verify_ctx_reset()
223 ctx->saved_error = 0; in x509_verify_ctx_reset()
224 ctx->saved_error_depth = 0; in x509_verify_ctx_reset()
[all …]
/dragonfly/sys/dev/drm/amd/display/dc/dce/
HDdce_aux.c31 aux110->base.ctx
36 engine->ctx->logger
422 struct read_command_context *ctx) in process_read_reply() argument
424 engine->funcs->process_channel_reply(engine, &ctx->reply); in process_read_reply()
426 switch (ctx->reply.status) { in process_read_reply()
428 ctx->defer_retry_aux = 0; in process_read_reply()
429 if (ctx->returned_byte > ctx->current_read_length) { in process_read_reply()
430 ctx->status = in process_read_reply()
432 ctx->operation_succeeded = false; in process_read_reply()
433 } else if (ctx->returned_byte < ctx->current_read_length) { in process_read_reply()
[all …]
/dragonfly/crypto/libressl/crypto/modes/
HDccm128.c63 void CRYPTO_ccm128_init(CCM128_CONTEXT *ctx, in CRYPTO_ccm128_init() argument
66 memset(ctx->nonce.c,0,sizeof(ctx->nonce.c)); in CRYPTO_ccm128_init()
67 ctx->nonce.c[0] = ((u8)(L-1)&7) | (u8)(((M-2)/2)&7)<<3; in CRYPTO_ccm128_init()
68 ctx->blocks = 0; in CRYPTO_ccm128_init()
69 ctx->block = block; in CRYPTO_ccm128_init()
70 ctx->key = key; in CRYPTO_ccm128_init()
76 int CRYPTO_ccm128_setiv(CCM128_CONTEXT *ctx, in CRYPTO_ccm128_setiv() argument
79 unsigned int L = ctx->nonce.c[0]&7; /* the L parameter */ in CRYPTO_ccm128_setiv()
84 ctx->nonce.c[8] = (u8)(mlen>>(56%(sizeof(mlen)*8))); in CRYPTO_ccm128_setiv()
85 ctx->nonce.c[9] = (u8)(mlen>>(48%(sizeof(mlen)*8))); in CRYPTO_ccm128_setiv()
[all …]
/dragonfly/contrib/tre/lib/
HDtre-parse.c205 #define REST(re) (int)(ctx->re_end - (re)), (re)
246 tre_parse_bracket_items(tre_parse_ctx_t *ctx, tre_bracket_match_list_t **items, in tre_parse_bracket_items() argument
249 const tre_char_t *re = ctx->re; in tre_parse_bracket_items()
250 const tre_char_t *re_end = ctx->re_end; in tre_parse_bracket_items()
270 if (re == ctx->re) in tre_parse_bracket_items()
357 if (__collate_equiv_value(ctx->loc, start, in tre_parse_bracket_items()
447 status = tre_new_item(ctx->mem, TRE_BRACKET_MATCH_TYPE_CHAR, in tre_parse_bracket_items()
500 if ((equiv = __collate_equiv_value(ctx->loc, in tre_parse_bracket_items()
530 status = tre_new_item(ctx->mem, in tre_parse_bracket_items()
559 ctx->loc); in tre_parse_bracket_items()
[all …]
/dragonfly/contrib/dhcpcd/src/
HDdhcpcd.c132 free_globals(struct dhcpcd_ctx *ctx) in free_globals() argument
136 if (ctx->ifac) { in free_globals()
137 for (; ctx->ifac > 0; ctx->ifac--) in free_globals()
138 free(ctx->ifav[ctx->ifac - 1]); in free_globals()
139 free(ctx->ifav); in free_globals()
140 ctx->ifav = NULL; in free_globals()
142 if (ctx->ifdc) { in free_globals()
143 for (; ctx->ifdc > 0; ctx->ifdc--) in free_globals()
144 free(ctx->ifdv[ctx->ifdc - 1]); in free_globals()
145 free(ctx->ifdv); in free_globals()
[all …]
/dragonfly/crypto/libressl/tls/
HDtls.c69 tls_error(struct tls *ctx) in tls_error() argument
71 return ctx->error.msg; in tls_error()
173 tls_set_error(struct tls *ctx, const char *fmt, ...) in tls_set_error() argument
181 rv = tls_error_vset(&ctx->error, errnum, fmt, ap); in tls_set_error()
188 tls_set_errorx(struct tls *ctx, const char *fmt, ...) in tls_set_errorx() argument
194 rv = tls_error_vset(&ctx->error, -1, fmt, ap); in tls_set_errorx()
201 tls_set_ssl_errorx(struct tls *ctx, const char *fmt, ...) in tls_set_ssl_errorx() argument
207 if (ctx->error.tls != 0) in tls_set_ssl_errorx()
211 rv = tls_error_vset(&ctx->error, -1, fmt, ap); in tls_set_ssl_errorx()
238 struct tls *ctx; in tls_new() local
[all …]
HDtls_client.c39 struct tls *ctx; in tls_client() local
44 if ((ctx = tls_new()) == NULL) in tls_client()
47 ctx->flags |= TLS_CLIENT; in tls_client()
49 return (ctx); in tls_client()
53 tls_connect(struct tls *ctx, const char *host, const char *port) in tls_connect() argument
55 return tls_connect_servername(ctx, host, port, NULL); in tls_connect()
59 tls_connect_servername(struct tls *ctx, const char *host, const char *port, in tls_connect_servername() argument
67 if ((ctx->flags & TLS_CLIENT) == 0) { in tls_connect_servername()
68 tls_set_errorx(ctx, "not a client context"); in tls_connect_servername()
73 tls_set_errorx(ctx, "host not specified"); in tls_connect_servername()
[all …]
HDtls_conninfo.c59 tls_get_peer_cert_hash(struct tls *ctx, char **hash) in tls_get_peer_cert_hash() argument
62 if (ctx->ssl_peer_cert == NULL) in tls_get_peer_cert_hash()
65 if (tls_cert_hash(ctx->ssl_peer_cert, hash) == -1) { in tls_get_peer_cert_hash()
66 tls_set_errorx(ctx, "unable to compute peer certificate hash - out of memory"); in tls_get_peer_cert_hash()
74 tls_get_peer_cert_issuer(struct tls *ctx, char **issuer) in tls_get_peer_cert_issuer() argument
79 if (ctx->ssl_peer_cert == NULL) in tls_get_peer_cert_issuer()
81 if ((name = X509_get_issuer_name(ctx->ssl_peer_cert)) == NULL) in tls_get_peer_cert_issuer()
90 tls_get_peer_cert_subject(struct tls *ctx, char **subject) in tls_get_peer_cert_subject() argument
95 if (ctx->ssl_peer_cert == NULL) in tls_get_peer_cert_subject()
97 if ((name = X509_get_subject_name(ctx->ssl_peer_cert)) == NULL) in tls_get_peer_cert_subject()
[all …]
/dragonfly/crypto/libressl/crypto/ts/
HDts_rsp_sign.c78 static void TS_RESP_CTX_init(TS_RESP_CTX *ctx);
79 static void TS_RESP_CTX_cleanup(TS_RESP_CTX *ctx);
80 static int TS_RESP_check_request(TS_RESP_CTX *ctx);
81 static ASN1_OBJECT *TS_RESP_get_policy(TS_RESP_CTX *ctx);
82 static TS_TST_INFO *TS_RESP_create_tst_info(TS_RESP_CTX *ctx,
84 static int TS_RESP_process_extensions(TS_RESP_CTX *ctx);
85 static int TS_RESP_sign(TS_RESP_CTX *ctx);
99 def_serial_cb(struct TS_resp_ctx *ctx, void *data) in def_serial_cb() argument
111 TS_RESP_CTX_set_status_info(ctx, TS_STATUS_REJECTION, in def_serial_cb()
118 def_time_cb(struct TS_resp_ctx *ctx, void *data, time_t *sec, long *usec) in def_time_cb() argument
[all …]
/dragonfly/crypto/libressl/crypto/bio/
HDbf_buff.c100 BIO_F_BUFFER_CTX *ctx; in buffer_new() local
102 ctx = malloc(sizeof(BIO_F_BUFFER_CTX)); in buffer_new()
103 if (ctx == NULL) in buffer_new()
105 ctx->ibuf = malloc(DEFAULT_BUFFER_SIZE); in buffer_new()
106 if (ctx->ibuf == NULL) { in buffer_new()
107 free(ctx); in buffer_new()
110 ctx->obuf = malloc(DEFAULT_BUFFER_SIZE); in buffer_new()
111 if (ctx->obuf == NULL) { in buffer_new()
112 free(ctx->ibuf); in buffer_new()
113 free(ctx); in buffer_new()
[all …]
/dragonfly/crypto/libressl/ssl/
HDtls13_handshake.c34 int (*send)(struct tls13_ctx *ctx, CBB *cbb);
35 int (*sent)(struct tls13_ctx *ctx);
36 int (*recv)(struct tls13_ctx *ctx, CBS *cbs);
40 tls13_handshake_active_state(struct tls13_ctx *ctx);
43 tls13_handshake_active_action(struct tls13_ctx *ctx);
44 static int tls13_handshake_advance_state_machine(struct tls13_ctx *ctx);
46 static int tls13_handshake_send_action(struct tls13_ctx *ctx,
48 static int tls13_handshake_recv_action(struct tls13_ctx *ctx,
51 static int tls13_handshake_set_legacy_state(struct tls13_ctx *ctx);
52 static int tls13_handshake_legacy_info_callback(struct tls13_ctx *ctx);
[all …]
/dragonfly/contrib/wpa_supplicant/src/crypto/
HDcrypto_internal.c42 struct crypto_hash *ctx; in crypto_hash_init() local
47 ctx = os_zalloc(sizeof(*ctx)); in crypto_hash_init()
48 if (ctx == NULL) in crypto_hash_init()
51 ctx->alg = alg; in crypto_hash_init()
55 MD5Init(&ctx->u.md5); in crypto_hash_init()
58 SHA1Init(&ctx->u.sha1); in crypto_hash_init()
62 sha256_init(&ctx->u.sha256); in crypto_hash_init()
67 sha384_init(&ctx->u.sha384); in crypto_hash_init()
72 sha512_init(&ctx->u.sha512); in crypto_hash_init()
77 MD5Init(&ctx->u.md5); in crypto_hash_init()
[all …]
/dragonfly/crypto/libressl/crypto/cmac/
HDcmac.c98 CMAC_CTX *ctx; in CMAC_CTX_new() local
100 ctx = malloc(sizeof(CMAC_CTX)); in CMAC_CTX_new()
101 if (!ctx) in CMAC_CTX_new()
103 EVP_CIPHER_CTX_init(&ctx->cctx); in CMAC_CTX_new()
104 ctx->nlast_block = -1; in CMAC_CTX_new()
105 return ctx; in CMAC_CTX_new()
109 CMAC_CTX_cleanup(CMAC_CTX *ctx) in CMAC_CTX_cleanup() argument
111 EVP_CIPHER_CTX_cleanup(&ctx->cctx); in CMAC_CTX_cleanup()
112 explicit_bzero(ctx->tbl, EVP_MAX_BLOCK_LENGTH); in CMAC_CTX_cleanup()
113 explicit_bzero(ctx->k1, EVP_MAX_BLOCK_LENGTH); in CMAC_CTX_cleanup()
[all …]
/dragonfly/contrib/smbfs/lib/smb/
HDctx.c63 smb_ctx_init(struct smb_ctx *ctx, int argc, char *argv[], in smb_ctx_init() argument
71 bzero(ctx,sizeof(*ctx)); in smb_ctx_init()
72 error = nb_ctx_create(&ctx->ct_nb); in smb_ctx_init()
75 ctx->ct_fd = -1; in smb_ctx_init()
76 ctx->ct_parsedlevel = SMBL_NONE; in smb_ctx_init()
77 ctx->ct_minlevel = minlevel; in smb_ctx_init()
78 ctx->ct_maxlevel = maxlevel; in smb_ctx_init()
80 ctx->ct_ssn.ioc_opt = SMBVOPT_CREATE; in smb_ctx_init()
81 ctx->ct_ssn.ioc_timeout = 15; in smb_ctx_init()
82 ctx->ct_ssn.ioc_retrycount = 4; in smb_ctx_init()
[all …]

12345678910>>...48