Home
last modified time | relevance | path

Searched refs:cipher (Results 1 – 25 of 169) sorted by relevance

1234567

/openbsd-src/lib/libcrypto/evp/
H A Devp_names.c33 const EVP_CIPHER *(*cipher)(void); member
51 .cipher = EVP_aes_128_cbc,
55 .cipher = EVP_aes_128_cfb128,
59 .cipher = EVP_aes_128_cfb1,
63 .cipher = EVP_aes_128_cfb8,
67 .cipher = EVP_aes_128_ctr,
71 .cipher = EVP_aes_128_ecb,
75 .cipher = EVP_aes_128_ofb,
79 .cipher = EVP_aes_128_xts,
84 .cipher
1486 const struct cipher_name *cipher = &cipher_names[i]; EVP_CIPHER_do_all_sorted() local
1547 OBJ_NAME_from_cipher_name(OBJ_NAME * obj_name,const struct cipher_name * cipher) OBJ_NAME_from_cipher_name() argument
1573 const struct cipher_name *cipher = &cipher_names[i]; OBJ_NAME_do_all_ciphers() local
1645 const struct cipher_name *cipher; EVP_get_cipherbyname() local
[all...]
H A Devp_cipher.c125 EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, in EVP_CipherInit() argument
128 return EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, enc); in EVP_CipherInit()
133 EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *engine, in EVP_CipherInit_ex() argument
142 if (cipher == NULL && ctx->cipher == NULL) { in EVP_CipherInit_ex()
151 if (cipher != NULL) { in EVP_CipherInit_ex()
158 ctx->cipher = cipher; in EVP_CipherInit_ex()
159 ctx->key_len = cipher->key_len; in EVP_CipherInit_ex()
161 if (ctx->cipher->ctx_size != 0) { in EVP_CipherInit_ex()
162 ctx->cipher_data = calloc(1, ctx->cipher->ctx_size); in EVP_CipherInit_ex()
169 if ((ctx->cipher->flags & EVP_CIPH_CTRL_INIT) != 0) { in EVP_CipherInit_ex()
[all …]
H A Devp_pbe.c77 ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md, int en_de);
81 ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md_type,
185 const EVP_CIPHER *cipher = NULL; in EVP_PBE_CipherInit() local
213 if ((cipher = EVP_get_cipherbynid(cfg->cipher_nid)) == NULL) { in EVP_PBE_CipherInit()
225 if (!cfg->keygen(ctx, pass, passlen, param, cipher, md, en_de)) { in EVP_PBE_CipherInit()
235 ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md, int en_de) in PKCS5_PBE_keyivgen() argument
299 if ((size_t)EVP_CIPHER_key_length(cipher) > sizeof(md_tmp)) { in PKCS5_PBE_keyivgen()
303 memcpy(key, md_tmp, EVP_CIPHER_key_length(cipher)); in PKCS5_PBE_keyivgen()
304 if ((size_t)EVP_CIPHER_iv_length(cipher) > 16) { in PKCS5_PBE_keyivgen()
308 memcpy(iv, md_tmp + (16 - EVP_CIPHER_iv_length(cipher)), in PKCS5_PBE_keyivgen()
[all …]
/openbsd-src/regress/lib/libssl/interop/cipher/
H A DMakefile7 # have used correct cipher by grepping in their session print out.
23 sed -n 's/^cipher //p' <$@.tmp | sort -u >$@
30 sed -n 's/^cipher //p' <$@.tmp | sort -u >$@
78 .for cipher in ${CIPHERS_${clib}_${slib}}
80 .if "${cipher:M*-DSS-*}" != ""
81 TYPE_${cipher} = dsa
82 .elif "${cipher:M*-ECDSA-*}" != ""
83 TYPE_${cipher} = ec
84 .elif "${cipher:M*-RSA-*}" != ""
85 TYPE_${cipher}
[all...]
/openbsd-src/lib/libssl/test/
H A Dtestenc10 $cmd enc < $test > $test.cipher
11 $cmd enc < $test.cipher >$test.clear
17 /bin/rm $test.cipher $test.clear
20 $cmd enc -a -e < $test > $test.cipher
21 $cmd enc -a -d < $test.cipher >$test.clear
27 /bin/rm $test.cipher $test.clear
30 for i in `$cmd list-cipher-commands`
33 $cmd $i -bufsize 113 -e -k test < $test > $test.$i.cipher
34 $cmd $i -bufsize 157 -d -k test < $test.$i.cipher >$test.$i.clear
40 /bin/rm $test.$i.cipher $test.$i.clear
[all …]
H A Dtestssl125 for cipher in `../util/shlib_wrap.sh ../apps/openssl ciphers "RSA+$protocol" | tr ':' ' '`; do
126 echo "Testing $cipher"
131 $ssltest -cipher $cipher $prot
133 echo "Failed $cipher"
145 $ssltest -v -bio_pair -tls1 -cipher ADH -dhe1024dsa -num 10 -f -time $extra || exit 1
163 $ssltest -tls1 -cipher PSK -psk abc123 $extra || exit 1
166 $ssltest -bio_pair -tls1 -cipher PSK -psk abc123 $extra || exit 1
172 $ssltest -tls1 -cipher SRP -srpuser test -srppass abc123
175 $ssltest -bio_pair -tls1 -cipher SRP -srpuser test -srppass abc123
/openbsd-src/regress/lib/libcrypto/evp/
H A Devptest.c243 test_cipher(const char *cipher, const unsigned char *key, int kn, in test_cipher() argument
249 c = EVP_get_cipherbyname(cipher); in test_cipher()
348 char *cipher; in main() local
358 cipher=sstrsep(&p, ":"); in main()
376 if (!test_cipher(cipher, key, kn, iv, in, plaintext, pn, ciphertext, cn, encdec) && in main()
377 !test_digest(cipher, plaintext, pn, ciphertext, cn)) { in main()
379 if (strstr(cipher, "AES") == cipher && verbose) { in main()
381 fprintf(stdout, "Cipher disabled, skipping %s\n", cipher); in main()
386 if (strstr(cipher, "DES") == cipher && verbose) { in main()
388 fprintf(stdout, "Cipher disabled, skipping %s\n", cipher); in main()
[all …]
H A Devp_test.c266 const EVP_CIPHER *(*cipher)(void); member
272 .cipher = EVP_aes_128_ccm,
278 .cipher = EVP_aes_128_ccm,
284 .cipher = EVP_aes_128_ccm,
290 .cipher = EVP_aes_128_ccm,
297 .cipher = EVP_aes_192_ccm,
303 .cipher = EVP_aes_192_ccm,
309 .cipher = EVP_aes_192_ccm,
315 .cipher = EVP_aes_192_ccm,
322 .cipher = EVP_aes_256_ccm,
[all …]
/openbsd-src/regress/lib/libssl/ssl/
H A Dtestssl58 for cipher in `$openssl ciphers -v "$protocol+aRSA" |
60 echo "Testing $cipher"
61 $ssltest -cipher $cipher -tls1_2
63 echo "Failed $cipher"
70 for cipher in `$openssl ciphers -v "$protocol" |
72 echo "Testing $cipher"
73 $ssltest -cipher $cipher -seclevel 2
75 echo "Failed $cipher"
82 for cipher in `$openssl ciphers -v "$protocol" |
84 echo "Testing $cipher"
[all …]
/openbsd-src/lib/libssl/
H A Dssl_ciphers.c26 ssl_cipher_in_list(STACK_OF(SSL_CIPHER) *ciphers, const SSL_CIPHER *cipher) in ssl_cipher_in_list() argument
31 if (sk_SSL_CIPHER_value(ciphers, i)->value == cipher->value) in ssl_cipher_in_list()
39 ssl_cipher_allowed_in_tls_version_range(const SSL_CIPHER *cipher, uint16_t min_ver, in ssl_cipher_allowed_in_tls_version_range() argument
42 switch(cipher->algorithm_ssl) { in ssl_cipher_allowed_in_tls_version_range()
56 SSL_CIPHER *cipher; in ssl_cipher_list_to_bytes() local
68 if ((cipher = sk_SSL_CIPHER_value(ciphers, i)) == NULL) in ssl_cipher_list_to_bytes()
70 if (!ssl_cipher_allowed_in_tls_version_range(cipher, min_vers, in ssl_cipher_list_to_bytes()
73 if (!ssl_security_cipher_check(s, cipher)) in ssl_cipher_list_to_bytes()
75 if (!CBB_add_u16(cbb, cipher->value)) in ssl_cipher_list_to_bytes()
97 const SSL_CIPHER *cipher; in STACK_OF() local
207 const SSL_CIPHER *cipher; ssl_parse_ciphersuites() local
263 const SSL_CIPHER *cipher; ssl_merge_cipherlists() local
[all...]
H A Dssl_seclevel.c98 const SSL_CIPHER *cipher = arg; in ssl_security_secop_cipher() local
112 if (cipher->algorithm_auth & SSL_aNULL) in ssl_security_secop_cipher()
115 if (cipher->algorithm_mac & SSL_MD5) in ssl_security_secop_cipher()
121 if (cipher->algorithm_enc & SSL_RC4) in ssl_security_secop_cipher()
127 /* Security level >= 3 requires a cipher with forward secrecy. */ in ssl_security_secop_cipher()
128 if ((cipher->algorithm_mkey & (SSL_kDHE | SSL_kECDHE)) == 0 && in ssl_security_secop_cipher()
129 cipher->algorithm_ssl != SSL_TLSV1_3) in ssl_security_secop_cipher()
135 if (cipher->algorithm_mac & SSL_SHA1) in ssl_security_secop_cipher()
204 int version, void *cipher, void *ex_data) in ssl_security_default_cb() argument
210 return ssl_security_secop_cipher(ctx, ssl, bits, cipher); in ssl_security_default_cb()
261 ssl_security_cipher(const SSL * ssl,SSL_CIPHER * cipher,int secop) ssl_security_cipher() argument
267 ssl_security_cipher_check(const SSL * ssl,SSL_CIPHER * cipher) ssl_security_cipher_check() argument
273 ssl_security_shared_cipher(const SSL * ssl,SSL_CIPHER * cipher) ssl_security_shared_cipher() argument
279 ssl_security_supported_cipher(const SSL * ssl,SSL_CIPHER * cipher) ssl_security_supported_cipher() argument
[all...]
H A Dssl_ciph.c113 * ECC cipher suite support in OpenSSL originally developed by
158 const SSL_CIPHER *cipher; member
365 /* cipher suite aliases */
403 const SSL_CIPHER *cipher;
410 if ((cipher = s->s3->hs.cipher) == NULL)
417 if (cipher->algorithm_mac & SSL_AEAD) in ssl_cipher_get_evp()
420 switch (cipher->algorithm_enc) { in ssl_cipher_get_evp()
444 switch (cipher->algorithm_mac) { in ssl_cipher_get_evp()
478 * for s->cipher in ssl_cipher_get_evp()
1154 const SSL_CIPHER *cipher; STACK_OF() local
1345 SSL_CIPHER_description(const SSL_CIPHER * cipher,char * buf,int len) SSL_CIPHER_description() argument
[all...]
H A Dt1_enc.c347 const EVP_CIPHER *cipher = NULL; in tls1_setup_key_block() local
360 if (s->s3->hs.cipher == NULL) in tls1_setup_key_block()
363 if ((s->s3->hs.cipher->algorithm_mac & SSL_AEAD) != 0) { in tls1_setup_key_block()
370 if (!ssl_cipher_get_evp(s, &cipher, &mac_hash, in tls1_setup_key_block()
381 tls12_record_layer_set_cipher_hash(s->rl, cipher, in tls1_setup_key_block()
386 if (!tls12_key_block_generate(key_block, s, aead, cipher, mac_hash)) in tls1_setup_key_block()
400 if (s->s3->hs.cipher != NULL) { in tls1_setup_key_block()
401 if (s->s3->hs.cipher->algorithm_enc == SSL_eNULL) in tls1_setup_key_block()
405 if (s->s3->hs.cipher->algorithm_enc == SSL_RC4) in tls1_setup_key_block()
/openbsd-src/regress/usr.bin/openssl/
H A Dtestenc.sh13 $cmd enc < $test > $test.cipher
14 $cmd enc < $test.cipher >$test.clear
20 /bin/rm $test.cipher $test.clear
23 $cmd enc -a -e < $test > $test.cipher
24 $cmd enc -a -d < $test.cipher >$test.clear
30 /bin/rm $test.cipher $test.clear
48 $cmd $i -bufsize 113 -e -k test < $test > $test.$i.cipher
49 $cmd $i -bufsize 157 -d -k test < $test.$i.cipher >$test.$i.clear
55 /bin/rm $test.$i.cipher $test.$i.clear
59 $cmd $i -bufsize 113 -a -e -k test < $test > $test.$i.cipher
[all …]
/openbsd-src/usr.bin/ssh/
H A Dcipher.c1 /* $OpenBSD: cipher.c,v 1.123 2024/08/23 04:51:00 deraadt Exp $ */
44 #include "cipher.h"
60 const struct sshcipher *cipher; member
177 * Default is cipher block size, except for chacha20+poly1305 that in cipher_ivlen()
233 if (cc == NULL || cc->cipher == NULL) in cipher_warning_message()
240 cipher_init(struct sshcipher_ctx **ccp, const struct sshcipher *cipher, in cipher_init() argument
255 cc->plaintext = (cipher->flags & CFLAG_NONE) != 0; in cipher_init()
258 if (keylen < cipher->key_len || in cipher_init()
259 (iv != NULL && ivlen < cipher_ivlen(cipher))) { in cipher_init()
264 cc->cipher in cipher_init()
[all...]
/openbsd-src/regress/lib/libradius/
H A Dtest24.c11 uint8_t cipher[256],cipher1[256]; in test24() local
24 clen = sizeof(cipher); in test24()
25 CHECK(radius_encrypt_user_password_attr(cipher, &clen, "challenge", ra, "xyzzy5461") == 0); in test24()
27 CHECK(memcmp(cipher, encryptedpass, 16) == 0); in test24()
29 CHECK(radius_decrypt_user_password_attr(plain, sizeof(plain), cipher, clen, ra, "xyzzy5461") == 0); in test24()
33 CHECK(radius_encrypt_user_password_attr(cipher, &clen, "challenge", ra, "xyzzy5461") != 0); in test24()
34 CHECK(radius_decrypt_user_password_attr(plain, 16, cipher, 16, ra, "xyzzy5461") != 0); in test24()
35 CHECK(radius_decrypt_user_password_attr(plain, 256, cipher, 17, ra, "xyzzy5461") != 0); in test24()
43 …radius_encrypt_user_password_attr(cipher, &clen, "foobarbaz", radius_get_authenticator_retval(pack… in test24()
44 CHECK(memcmp(cipher1, cipher, 16) == 0); in test24()
H A Dtest25.c26 uint8_t cipher[256]; in test25() local
35 clen = sizeof(cipher); in test25()
36 CHECK(radius_encrypt_mppe_key_attr(cipher, &clen, plainkey, 16, ra, "hogehogefugafuga") == 0); in test25()
40 CHECK(radius_decrypt_mppe_key_attr(plain, &plen, cipher, clen, ra, "hogehogefugafuga") == 0); in test25()
45 CHECK(radius_encrypt_mppe_key_attr(cipher, &clen, plainkey, 16, ra, "hogehogefugafuga") != 0); in test25()
47 CHECK(radius_decrypt_mppe_key_attr(plain, &plen, cipher, 34, ra, "hogehogefugafuga") != 0); in test25()
49 CHECK(radius_decrypt_mppe_key_attr(plain, &plen, cipher, 33, ra, "hogehogefugafuga") != 0); in test25()
54 clen = sizeof(cipher); in test25()
55 …CHECK(radius_get_vs_raw_attr(packet, RADIUS_VENDOR_MICROSOFT, RADIUS_VTYPE_MPPE_SEND_KEY, cipher, … in test25()
58 …CHECK(radius_decrypt_mppe_key_attr(plain, &plen, cipher, clen, radius_get_authenticator_retval(pac… in test25()
[all …]
/openbsd-src/lib/libradius/
H A Dradius_mppe.c45 radius_encrypt_mppe_key_attr(void *cipher, size_t * clen, const void *plain, in radius_encrypt_mppe_key_attr() argument
66 memcpy(cipher, &salt, 2); in radius_encrypt_mppe_key_attr()
68 c = ((uint8_t *)cipher) + 2 + off; in radius_encrypt_mppe_key_attr()
74 MD5_Update(&ctx, cipher, 2); in radius_encrypt_mppe_key_attr()
86 radius_decrypt_mppe_key_attr(void *plain, size_t * plen, const void *cipher, in radius_decrypt_mppe_key_attr() argument
103 c = ((uint8_t *)cipher) + 2 + off; in radius_decrypt_mppe_key_attr()
109 MD5_Update(&ctx, cipher, 2); in radius_decrypt_mppe_key_attr()
129 uint8_t cipher[256]; in radius_get_mppe_key_attr() local
130 size_t clen = sizeof(cipher); in radius_get_mppe_key_attr()
133 cipher, &clen) != 0) in radius_get_mppe_key_attr()
[all …]
H A Dradius_userpass.c39 radius_encrypt_user_password_attr(void *cipher, size_t * clen, in radius_encrypt_user_password_attr() argument
53 c = ((char *)cipher) + off; in radius_encrypt_user_password_attr()
72 radius_decrypt_user_password_attr(char *plain, size_t plen, const void *cipher, in radius_decrypt_user_password_attr() argument
88 c = ((char *)cipher) + off; in radius_decrypt_user_password_attr()
119 char cipher[256]; in radius_get_user_password_attr() local
120 size_t clen = sizeof(cipher); in radius_get_user_password_attr()
122 if (radius_get_raw_attr(packet, RADIUS_TYPE_USER_PASSWORD, cipher, in radius_get_user_password_attr()
125 if (radius_decrypt_user_password_attr(buf, len, cipher, clen, in radius_get_user_password_attr()
136 char cipher[256]; in radius_put_user_password_attr() local
137 size_t clen = sizeof(cipher); in radius_put_user_password_attr()
[all …]
/openbsd-src/regress/lib/libssl/ciphers/
H A Dcipherstest.c40 const SSL_CIPHER *cipher; in check_cipher_order()
47 if ((cipher = ssl3_get_cipher_by_index(i)) == NULL) { in check_cipher_order()
52 if ((id = SSL_CIPHER_get_id(cipher)) <= prev_id) { in check_cipher_order()
54 "id - cipher %d (%lx) <= cipher %d (%lx)\n", in check_cipher_order()
723 const SSL_CIPHER *cipher;
760 cipher = sk_SSL_CIPHER_value(ciphers, i);
761 cipher_value = SSL_CIPHER_get_value(cipher);
766 if ((cipher = SSL_CIPHER_find(ssl, buf)) == NULL) {
768 SSL_CIPHER_get_name(cipher));
42 const SSL_CIPHER *cipher; check_cipher_order() local
74 const SSL_CIPHER *cipher; cipher_find_test() local
201 SSL_CIPHER *cipher; parse_ciphersuites_test() local
389 SSL_CIPHER *cipher; cipher_set_test() local
[all...]
/openbsd-src/regress/usr.bin/ssh/
H A Ddhgex.sh15 cipher="$1"; shift
20 echo "Ciphers=$cipher" >> $OBJ/sshd_proxy
22 opts="-oKexAlgorithms=$kex -oCiphers=$cipher"
26 verbose "$tid bits $bits $kex $cipher"
58 check 3072 `${SSH} -Q cipher | grep 128`
59 check 7680 `${SSH} -Q cipher | grep 192`
60 check 8192 `${SSH} -Q cipher | grep 256`
/openbsd-src/usr.bin/openssl/
H A Denc.c79 const EVP_CIPHER *cipher; member
109 cfg.cipher = NULL; in enc_opt_cipher()
114 if ((cfg.cipher = EVP_get_cipherbyname(name)) != NULL) { in enc_opt_cipher()
296 const EVP_CIPHER *cipher; in skip_aead_and_xts() local
298 if ((cipher = EVP_get_cipherbyname(name->name)) == NULL) in skip_aead_and_xts()
301 if ((EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER) != 0) in skip_aead_and_xts()
303 if (EVP_CIPHER_mode(cipher) == EVP_CIPH_XTS_MODE) in skip_aead_and_xts()
361 cfg.cipher = EVP_get_cipherbyname(pname); in enc_main()
363 if (!cfg.base64 && cfg.cipher == NULL && strcmp(pname, "enc") != 0) { in enc_main()
403 if (cfg.cipher != NULL && in enc_main()
[all …]
/openbsd-src/regress/lib/libcrypto/aead/
H A Daeadtest.c95 aead_from_name(const EVP_AEAD **aead, const EVP_CIPHER **cipher, in aead_from_name() argument
99 *cipher = NULL; in aead_from_name()
103 *cipher = EVP_aes_128_gcm(); in aead_from_name()
105 *cipher = EVP_aes_192_gcm(); in aead_from_name()
108 *cipher = EVP_aes_256_gcm(); in aead_from_name()
111 *cipher = EVP_chacha20_poly1305(); in aead_from_name()
198 run_cipher_aead_encrypt_test(const EVP_CIPHER *cipher, in run_cipher_aead_encrypt_test() argument
214 if (!EVP_EncryptInit_ex(ctx, cipher, NULL, NULL, NULL)) { in run_cipher_aead_encrypt_test()
291 run_cipher_aead_decrypt_test(const EVP_CIPHER *cipher, int invalid, in run_cipher_aead_decrypt_test() argument
306 if (!EVP_DecryptInit_ex(ctx, cipher, NULL, NULL, NULL)) { in run_cipher_aead_decrypt_test()
[all …]
/openbsd-src/lib/libcrypto/cms/
H A Dcms_enc.c88 enc = ec->cipher ? 1 : 0; in cms_EncryptedContent_init_bio()
99 ciph = ec->cipher; in cms_EncryptedContent_init_bio()
101 * If not keeping key set cipher to NULL so subsequent calls decrypt. in cms_EncryptedContent_init_bio()
104 ec->cipher = NULL; in cms_EncryptedContent_init_bio()
212 const EVP_CIPHER *cipher, const unsigned char *key, size_t keylen) in cms_EncryptedContent_init() argument
214 ec->cipher = cipher; in cms_EncryptedContent_init()
223 if (cipher) in cms_EncryptedContent_init()
262 if (enc->encryptedContentInfo->cipher && enc->unprotectedAttrs) in cms_EncryptedData_init_bio()
/openbsd-src/lib/libcrypto/pem/
H A Dpem_lib.c282 EVP_CIPHER_INFO cipher; in PEM_bytes_read_bio() local
301 if (!PEM_get_EVP_CIPHER_INFO(header, &cipher)) in PEM_bytes_read_bio()
303 if (!PEM_do_header(&cipher, data, &len, cb, u)) in PEM_bytes_read_bio()
443 PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *plen, in PEM_do_header() argument
454 if (cipher->cipher == NULL) in PEM_do_header()
464 if (!EVP_BytesToKey(cipher->cipher, EVP_md5(), &(cipher->iv[0]), in PEM_do_header()
470 o = EVP_DecryptInit_ex(&ctx, cipher->cipher, NULL, key, in PEM_do_header()
471 &(cipher->iv[0])); in PEM_do_header()
489 PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher) in PEM_get_EVP_CIPHER_INFO() argument
495 cipher->cipher = NULL; in PEM_get_EVP_CIPHER_INFO()
[all …]

1234567