/openssl/test/ |
H A D | cipherbytes_test.c | 29 STACK_OF(SSL_CIPHER) *sk = NULL, *scsv = NULL; in test_empty() 34 || !TEST_ptr_null(sk) in test_empty() 40 sk_SSL_CIPHER_free(sk); in test_empty() 47 STACK_OF(SSL_CIPHER) *sk, *scsv; in test_unsupported() 54 || !TEST_ptr(sk) in test_unsupported() 64 sk_SSL_CIPHER_free(sk); in test_unsupported() 71 STACK_OF(SSL_CIPHER) *sk, *scsv; in test_v2() 80 || !TEST_ptr(sk) in test_v2() 94 sk_SSL_CIPHER_free(sk); in test_v2() 109 || !TEST_ptr(sk) in test_v3() [all …]
|
H A D | ciphername_test.c | 386 STACK_OF(SSL_CIPHER) *sk = NULL; in test_cipher_name() 427 sk = SSL_get_ciphers(ssl); in test_cipher_name() 428 if (sk == NULL) { in test_cipher_name() 433 for (i = 0; i < sk_SSL_CIPHER_num(sk); i++) { in test_cipher_name() 434 c = sk_SSL_CIPHER_value(sk, i); in test_cipher_name()
|
H A D | x509_check_cert_pkey_test.c | 115 STACK_OF(X509_INFO) *sk; in test_PEM_X509_INFO_read_bio() 121 sk = PEM_X509_INFO_read_bio(in, NULL, NULL, ""); in test_PEM_X509_INFO_read_bio() 123 for (i = 0; i < sk_X509_INFO_num(sk); i++) { in test_PEM_X509_INFO_read_bio() 124 it = sk_X509_INFO_value(sk, i); in test_PEM_X509_INFO_read_bio() 132 sk_X509_INFO_pop_free(sk, X509_INFO_free); in test_PEM_X509_INFO_read_bio()
|
/openssl/include/openssl/ |
H A D | safestack.h.in | 48 return (const OPENSSL_STACK *)sk; \ 52 return (OPENSSL_STACK *)sk; \ 74 return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \ 94 return OPENSSL_sk_reserve((OPENSSL_STACK *)sk, n); \ 98 OPENSSL_sk_free((OPENSSL_STACK *)sk); \ 102 OPENSSL_sk_zero((OPENSSL_STACK *)sk); \ 106 return (t2 *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); \ 110 return (t2 *)OPENSSL_sk_delete_ptr((OPENSSL_STACK *)sk, \ 123 return (t2 *)OPENSSL_sk_pop((OPENSSL_STACK *)sk); \ 127 return (t2 *)OPENSSL_sk_shift((OPENSSL_STACK *)sk); \ [all …]
|
/openssl/crypto/x509/ |
H A D | x509_v3.c | 47 if (sk == NULL) in X509v3_get_ext_by_OBJ() 52 n = sk_X509_EXTENSION_num(sk); in X509v3_get_ext_by_OBJ() 54 ex = sk_X509_EXTENSION_value(sk, lastpos); in X509v3_get_ext_by_OBJ() 67 if (sk == NULL) in X509v3_get_ext_by_critical() 72 n = sk_X509_EXTENSION_num(sk); in X509v3_get_ext_by_critical() 106 STACK_OF(X509_EXTENSION) *sk = NULL; in STACK_OF() 119 sk = *x; in STACK_OF() 121 n = sk_X509_EXTENSION_num(sk); in STACK_OF() 136 *x = sk; in STACK_OF() 137 return sk; in STACK_OF() [all …]
|
H A D | x509name.c | 76 STACK_OF(X509_NAME_ENTRY) *sk; in X509_NAME_get_index_by_OBJ() 82 sk = name->entries; in X509_NAME_get_index_by_OBJ() 83 n = sk_X509_NAME_ENTRY_num(sk); in X509_NAME_get_index_by_OBJ() 105 STACK_OF(X509_NAME_ENTRY) *sk; in X509_NAME_delete_entry() 111 sk = name->entries; in X509_NAME_delete_entry() 112 ret = sk_X509_NAME_ENTRY_delete(sk, loc); in X509_NAME_delete_entry() 113 n = sk_X509_NAME_ENTRY_num(sk); in X509_NAME_delete_entry() 193 STACK_OF(X509_NAME_ENTRY) *sk; in X509_NAME_add_entry() 197 sk = name->entries; in X509_NAME_add_entry() 198 n = sk_X509_NAME_ENTRY_num(sk); in X509_NAME_add_entry() [all …]
|
H A D | x509_lu.c | 229 STACK_OF(X509_LOOKUP) *sk; in X509_STORE_free() 240 sk = xs->get_cert_methods; in X509_STORE_free() 246 sk_X509_LOOKUP_free(sk); in X509_STORE_free() 620 STACK_OF(X509) *sk; in STACK_OF() 643 return sk; in STACK_OF() 688 sk = sk_X509_new_null(); in STACK_OF() 702 return sk; in STACK_OF() 710 STACK_OF(X509_CRL) *sk; in STACK_OF() 721 return sk; in STACK_OF() 730 return sk; in STACK_OF() [all …]
|
H A D | x509_att.c | 42 if (sk == NULL) in X509at_get_attr_by_OBJ() 47 n = sk_X509_ATTRIBUTE_num(sk); in X509at_get_attr_by_OBJ() 49 ex = sk_X509_ATTRIBUTE_value(sk, lastpos); in X509at_get_attr_by_OBJ() 86 STACK_OF(X509_ATTRIBUTE) *sk = NULL; in STACK_OF() 99 sk = *x; in STACK_OF() 104 if (!sk_X509_ATTRIBUTE_push(sk, new_attr)) { in STACK_OF() 109 *x = sk; in STACK_OF() 110 return sk; in STACK_OF() 114 sk_X509_ATTRIBUTE_free(sk); in STACK_OF() 257 STACK_OF(X509_ATTRIBUTE) *sk = NULL; in STACK_OF() [all …]
|
H A D | x509_cmp.c | 195 if (sk == NULL) { in X509_add_cert() 206 for (i = 0; i < sk_X509_num(sk); i++) { in X509_add_cert() 207 if (X509_cmp(sk_X509_value(sk, i), cert) == 0) in X509_add_cert() 217 if (!sk_X509_insert(sk, cert, in X509_add_cert() 230 if (sk == NULL) { in X509_add_certs() 234 return ossl_x509_add_certs_new(&sk, certs, flags); in X509_add_certs() 354 if (!sk) in X509_find_by_issuer_and_serial() 360 for (i = 0; i < sk_X509_num(sk); i++) { in X509_find_by_issuer_and_serial() 361 x509 = sk_X509_value(sk, i); in X509_find_by_issuer_and_serial() 373 for (i = 0; i < sk_X509_num(sk); i++) { in X509_find_by_subject() [all …]
|
H A D | v3_conf.c | 304 while ((idx = X509v3_get_ext_by_OBJ(sk, obj, -1)) >= 0) in delete_ext() 305 X509_EXTENSION_free(X509v3_delete_ext(sk, idx)); in delete_ext() 314 STACK_OF(X509_EXTENSION) **sk) in X509V3_EXT_add_nconf_sk() 342 if (sk != NULL) { in X509V3_EXT_add_nconf_sk() 344 delete_ext(*sk, ext); in X509V3_EXT_add_nconf_sk() 345 if (X509v3_add_ext(sk, ext, -1) == NULL) { in X509V3_EXT_add_nconf_sk() 362 STACK_OF(X509_EXTENSION) **sk = NULL; in X509V3_EXT_add_nconf() 364 sk = &cert->cert_info.extensions; in X509V3_EXT_add_nconf() 365 return X509V3_EXT_add_nconf_sk(conf, ctx, section, sk); in X509V3_EXT_add_nconf() 375 STACK_OF(X509_EXTENSION) **sk = NULL; in X509V3_EXT_CRL_add_nconf() [all …]
|
/openssl/doc/man3/ |
H A D | DEFINE_STACK_OF.pod | 44 void sk_TYPE_free(STACK_OF(TYPE) *sk); 45 void sk_TYPE_zero(STACK_OF(TYPE) *sk); 50 TYPE *sk_TYPE_pop(STACK_OF(TYPE) *sk); 51 TYPE *sk_TYPE_shift(STACK_OF(TYPE) *sk); 103 B<sk_I<TYPE>_num>() returns the number of elements in I<sk> or -1 if I<sk> is 120 I<sk> structure is freed. On error I<sk> is unchanged. 136 elements of I<sk>. After this call I<sk> is no longer valid. 139 free I<sk> so after this call I<sk> is still valid. 141 B<sk_I<TYPE>_pop_free>() frees up all elements of I<sk> and I<sk> itself. The 158 sk_TYPE_insert(sk, ptr, -1); [all …]
|
H A D | X509_add_cert.pod | 13 int X509_add_cert(STACK_OF(X509) *sk, X509 *cert, int flags); 14 int X509_add_certs(STACK_OF(X509) *sk, STACK_OF(X509) *certs, int flags); 18 X509_add_cert() adds a certificate I<cert> to the given list I<sk>. 20 X509_add_certs() adds a list of certificate I<certs> to the given list I<sk>. 24 the reference counters of those of its members added to I<sk> are increased. 34 If B<X509_ADD_FLAG_PREPEND> is set then the certificates are prepended to I<sk>. 35 By default they are appended to I<sk>. 38 If B<X509_ADD_FLAG_NO_DUP> is set then certificates already contained in I<sk>, 53 the ownership is transferred to the list of certificates I<sk>. 55 Care should also be taken in case the I<certs> argument equals I<sk>.
|
/openssl/crypto/stack/ |
H A D | stack.c | 40 if (sk->comp != c) in OPENSSL_sk_set_cmp_func() 41 sk->sorted = 0; in OPENSSL_sk_set_cmp_func() 42 sk->comp = c; in OPENSSL_sk_set_cmp_func() 54 if (sk == NULL) { in OPENSSL_sk_dup() 60 *ret = *sk; in OPENSSL_sk_dup() 63 if (sk == NULL || sk->num == 0) { in OPENSSL_sk_dup() 74 memcpy(ret->data, sk->data, sizeof(void *) * sk->num); in OPENSSL_sk_dup() 92 if (sk == NULL) { in OPENSSL_sk_deep_copy() 98 *ret = *sk; in OPENSSL_sk_deep_copy() 101 if (sk == NULL || sk->num == 0) { in OPENSSL_sk_deep_copy() [all …]
|
/openssl/util/perl/OpenSSL/ |
H A D | ParseC.pm | 348 static ossl_inline int sk_$1_num(const STACK_OF($1) *sk); 354 static ossl_inline int sk_$1_reserve(STACK_OF($1) *sk, int n); 355 static ossl_inline void sk_$1_free(STACK_OF($1) *sk); 356 static ossl_inline void sk_$1_zero(STACK_OF($1) *sk); 357 static ossl_inline $2 *sk_$1_delete(STACK_OF($1) *sk, int i); 359 static ossl_inline int sk_$1_push(STACK_OF($1) *sk, $2 *ptr); 361 static ossl_inline $2 *sk_$1_pop(STACK_OF($1) *sk); 362 static ossl_inline $2 *sk_$1_shift(STACK_OF($1) *sk); 363 static ossl_inline void sk_$1_pop_free(STACK_OF($1) *sk, 367 static ossl_inline int sk_$1_find(STACK_OF($1) *sk, $2 *ptr); [all …]
|
/openssl/crypto/engine/ |
H A D | eng_table.c | 21 STACK_OF(ENGINE) *sk; 111 fnd->sk = sk_ENGINE_new_null(); in engine_table_register() 112 if (!fnd->sk) { in engine_table_register() 119 sk_ENGINE_free(fnd->sk); in engine_table_register() 125 (void)sk_ENGINE_delete_ptr(fnd->sk, e); in engine_table_register() 129 if (!sk_ENGINE_push(fnd->sk, e)) in engine_table_register() 155 while ((n = sk_ENGINE_find(pile->sk, e)) >= 0) { in int_unregister_cb() 156 (void)sk_ENGINE_delete(pile->sk, n); in int_unregister_cb() 181 sk_ENGINE_free(p->sk); in int_cleanup_cb_doall() 245 ret = sk_ENGINE_value(fnd->sk, loop++); in ossl_engine_table_select() [all …]
|
/openssl/crypto/conf/ |
H A D | conf_api.c | 167 STACK_OF(CONF_VALUE) *sk; in value_free_stack_doall() 173 sk = (STACK_OF(CONF_VALUE) *)a->value; in value_free_stack_doall() 174 for (i = sk_CONF_VALUE_num(sk) - 1; i >= 0; i--) { in value_free_stack_doall() 175 vv = sk_CONF_VALUE_value(sk, i); in value_free_stack_doall() 180 sk_CONF_VALUE_free(sk); in value_free_stack_doall() 187 STACK_OF(CONF_VALUE) *sk = NULL; in _CONF_new_section() 191 if ((sk = sk_CONF_VALUE_new_null()) == NULL) in _CONF_new_section() 201 v->value = (char *)sk; in _CONF_new_section() 209 sk_CONF_VALUE_free(sk); in _CONF_new_section()
|
/openssl/crypto/ct/ |
H A D | ct_oct.c | 256 STACK_OF(SCT) *sk = NULL; in STACK_OF() 271 sk = sk_SCT_new_null(); in STACK_OF() 272 if (sk == NULL) in STACK_OF() 278 sk = *a; in STACK_OF() 279 while ((sct = sk_SCT_pop(sk)) != NULL) in STACK_OF() 301 if (!sk_SCT_push(sk, sct)) { in STACK_OF() 308 *a = sk; in STACK_OF() 309 return sk; in STACK_OF() 313 SCT_LIST_free(sk); in STACK_OF() 374 STACK_OF(SCT) *sk = NULL; in STACK_OF() [all …]
|
/openssl/apps/ |
H A D | ciphers.c | 92 STACK_OF(SSL_CIPHER) *sk = NULL; in ciphers_main() 222 sk = SSL_get1_supported_ciphers(ssl); in ciphers_main() 224 sk = SSL_get_ciphers(ssl); in ciphers_main() 227 for (i = 0; i < sk_SSL_CIPHER_num(sk); i++) { in ciphers_main() 228 const SSL_CIPHER *c = sk_SSL_CIPHER_value(sk, i); in ciphers_main() 243 for (i = 0; i < sk_SSL_CIPHER_num(sk); i++) { in ciphers_main() 246 c = sk_SSL_CIPHER_value(sk, i); in ciphers_main() 280 sk_SSL_CIPHER_free(sk); in ciphers_main()
|
H A D | crl2pkcs7.c | 199 STACK_OF(X509_INFO) *sk = NULL; in add_certs_from_file() 209 sk = PEM_X509_INFO_read_bio(in, NULL, NULL, NULL); in add_certs_from_file() 210 if (sk == NULL) { in add_certs_from_file() 216 while (sk_X509_INFO_num(sk)) { in add_certs_from_file() 217 xi = sk_X509_INFO_shift(sk); in add_certs_from_file() 230 sk_X509_INFO_free(sk); in add_certs_from_file()
|
/openssl/crypto/pem/ |
H A D | pem_info.c | 29 *PEM_X509_INFO_read_ex(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, in STACK_OF() 40 ret = PEM_X509_INFO_read_bio_ex(b, sk, cb, u, libctx, propq); in STACK_OF() 45 STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, in STACK_OF() 48 return PEM_X509_INFO_read_ex(fp, sk, cb, u, NULL, NULL); in STACK_OF() 52 STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio_ex(BIO *bp, STACK_OF(X509_INFO) *sk, in STACK_OF() 68 if (sk == NULL) { in STACK_OF() 74 ret = sk; in STACK_OF() 206 if (ret != sk) in STACK_OF() 217 STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, in STACK_OF() 220 return PEM_X509_INFO_read_bio_ex(bp, sk, cb, u, NULL, NULL); in STACK_OF()
|
/openssl/crypto/asn1/ |
H A D | tasn_enc.c | 21 static int asn1_set_seq_out(STACK_OF(const_ASN1_VALUE) *sk, 303 for (i = 0; i < sk_const_ASN1_VALUE_num(sk); i++) { in asn1_template_ex_i2d() 304 skitem = sk_const_ASN1_VALUE_value(sk, i); in asn1_template_ex_i2d() 334 asn1_set_seq_out(sk, out, skcontlen, ASN1_ITEM_ptr(tt->item), in asn1_template_ex_i2d() 399 static int asn1_set_seq_out(STACK_OF(const_ASN1_VALUE) *sk, in asn1_set_seq_out() argument 411 if (sk_const_ASN1_VALUE_num(sk) < 2) in asn1_set_seq_out() 414 derlst = OPENSSL_malloc(sk_const_ASN1_VALUE_num(sk) in asn1_set_seq_out() 425 for (i = 0; i < sk_const_ASN1_VALUE_num(sk); i++) { in asn1_set_seq_out() 426 skitem = sk_const_ASN1_VALUE_value(sk, i); in asn1_set_seq_out() 435 skitem = sk_const_ASN1_VALUE_value(sk, i); in asn1_set_seq_out() [all …]
|
/openssl/crypto/ |
H A D | ex_data.c | 237 ad->sk = NULL; in ossl_crypto_new_ex_data_ex() 285 if (from->sk == NULL) in CRYPTO_dup_ex_data() 298 j = sk_void_num(from->sk); in CRYPTO_dup_ex_data() 414 sk_void_free(ad->sk); in CRYPTO_free_ex_data() 415 ad->sk = NULL; in CRYPTO_free_ex_data() 473 if (ad->sk == NULL) { in CRYPTO_set_ex_data() 480 for (i = sk_void_num(ad->sk); i <= idx; ++i) { in CRYPTO_set_ex_data() 481 if (!sk_void_push(ad->sk, NULL)) { in CRYPTO_set_ex_data() 486 if (sk_void_set(ad->sk, idx, val) != val) { in CRYPTO_set_ex_data() 500 if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) in CRYPTO_get_ex_data() [all …]
|
/openssl/crypto/pkcs7/ |
H A D | pk7_doit.c | 775 STACK_OF(X509_ATTRIBUTE) *sk; in PKCS7_dataFinal() 877 sk = si->auth_attr; in PKCS7_dataFinal() 1069 STACK_OF(X509_ATTRIBUTE) *sk; in PKCS7_signatureVerify() 1120 sk = si->auth_attr; in PKCS7_signatureVerify() 1121 if ((sk != NULL) && (sk_X509_ATTRIBUTE_num(sk) != 0)) { in PKCS7_signatureVerify() 1272 if (*sk == NULL) { in add_attribute() 1276 n = sk_X509_ATTRIBUTE_num(*sk); in add_attribute() 1278 attr = sk_X509_ATTRIBUTE_value(*sk, i); in add_attribute() 1282 if (!sk_X509_ATTRIBUTE_push(*sk, NULL)) in add_attribute() 1289 sk_X509_ATTRIBUTE_pop(*sk); in add_attribute() [all …]
|
H A D | pk7_lib.c | 254 STACK_OF(X509) **sk; in PKCS7_add_certificate() 259 sk = &(p7->d.sign->cert); in PKCS7_add_certificate() 275 STACK_OF(X509_CRL) **sk; in PKCS7_add_crl() 280 sk = &(p7->d.sign->crl); in PKCS7_add_crl() 290 if (*sk == NULL) in PKCS7_add_crl() 291 *sk = sk_X509_CRL_new_null(); in PKCS7_add_crl() 292 if (*sk == NULL) { in PKCS7_add_crl() 298 if (!sk_X509_CRL_push(*sk, crl)) { in PKCS7_add_crl() 584 STACK_OF(PKCS7_RECIP_INFO) *sk; in PKCS7_add_recipient_info() 592 sk = p7->d.enveloped->recipientinfo; in PKCS7_add_recipient_info() [all …]
|
/openssl/crypto/property/ |
H A D | property_parse.c | 313 STACK_OF(OSSL_PROPERTY_DEFINITION) *sk) in stack_to_property_list() 315 const int n = sk_OSSL_PROPERTY_DEFINITION_num(sk); in stack_to_property_list() 323 sk_OSSL_PROPERTY_DEFINITION_sort(sk); in stack_to_property_list() 349 STACK_OF(OSSL_PROPERTY_DEFINITION) *sk; in ossl_parse_property() 386 if (!sk_OSSL_PROPERTY_DEFINITION_push(sk, prop)) in ossl_parse_property() 396 res = stack_to_property_list(ctx, sk); in ossl_parse_property() 400 sk_OSSL_PROPERTY_DEFINITION_pop_free(sk, &pd_free); in ossl_parse_property() 407 STACK_OF(OSSL_PROPERTY_DEFINITION) *sk; in ossl_parse_query() 449 if (!sk_OSSL_PROPERTY_DEFINITION_push(sk, prop)) in ossl_parse_query() 459 res = stack_to_property_list(ctx, sk); in ossl_parse_query() [all …]
|