<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openssl.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Vincent</id>
	<title>OpenSSLWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openssl.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Vincent"/>
	<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php/Special:Contributions/Vincent"/>
	<updated>2026-04-09T23:45:43Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.13</generator>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=STACK_API&amp;diff=1407</id>
		<title>STACK API</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=STACK_API&amp;diff=1407"/>
		<updated>2014-01-14T00:07:23Z</updated>

		<summary type="html">&lt;p&gt;Vincent: page creation; must add functions description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The stack library provides a generic way to handle collections of objects in OpenSSL. A comparison function can be registered to sort the collection.&lt;br /&gt;
&lt;br /&gt;
Interface is split in two headers, &amp;lt;openssl/stack.h&amp;gt; and &amp;lt;openssl/safestack.h&amp;gt;. The former declares the C functions that will execute the insert, delete, pop, push, and other operations on the stack, while the latter declares a bunch of macros to enforce some type-checking by the compiler; these macros are mostly auto-generated by mkstack.pl.&lt;br /&gt;
&lt;br /&gt;
It is highly discouraged to use the C functions declared in &amp;lt;openssl/stack.h&amp;gt;. Rather, use the macros defined in &amp;lt;openssl/safestack.h&amp;gt; for OpenSSL built-in  stacks, and declare your own type-checking wrappers for your custom stacks.&lt;br /&gt;
&lt;br /&gt;
==Basic Use==&lt;br /&gt;
&lt;br /&gt;
A stack type is defined with the DECLARE_STACK_OF() macro and its instances are declared with the STACK_OF() macro.&lt;br /&gt;
&lt;br /&gt;
Example from &amp;lt;openssl/x509.h&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* a sequence of these are used */&lt;br /&gt;
typedef struct x509_attributes_st&lt;br /&gt;
        {&lt;br /&gt;
        ASN1_OBJECT *object;&lt;br /&gt;
        int single; /* 0 for a set, 1 for a single item (which is wrong) */&lt;br /&gt;
        union   {&lt;br /&gt;
                char            *ptr;&lt;br /&gt;
/* 0 */         STACK_OF(ASN1_TYPE) *set;&lt;br /&gt;
/* 1 */         ASN1_TYPE       *single;&lt;br /&gt;
                } value;&lt;br /&gt;
        } X509_ATTRIBUTE;&lt;br /&gt;
&lt;br /&gt;
DECLARE_STACK_OF(X509_ATTRIBUTE)&lt;br /&gt;
DECLARE_ASN1_SET_OF(X509_ATTRIBUTE)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
typedef struct X509_req_info_st&lt;br /&gt;
        {&lt;br /&gt;
        ASN1_ENCODING enc;&lt;br /&gt;
        ASN1_INTEGER *version;&lt;br /&gt;
        X509_NAME *subject;&lt;br /&gt;
        X509_PUBKEY *pubkey;&lt;br /&gt;
        /*  d=2 hl=2 l=  0 cons: cont: 00 */&lt;br /&gt;
        STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */&lt;br /&gt;
        } X509_REQ_INFO;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For each kind of stack, a set of macros is available to manipulate its state and contents. Here is an example with the BIO object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* allocate &amp;amp; free */&lt;br /&gt;
#define sk_BIO_new(cmp)                 SKM_sk_new(BIO, (cmp))&lt;br /&gt;
#define sk_BIO_new_null()               SKM_sk_new_null(BIO)&lt;br /&gt;
#define sk_BIO_free(st)                 SKM_sk_free(BIO, (st))&lt;br /&gt;
#define sk_BIO_pop_free(st, free_func)  SKM_sk_pop_free(BIO, (st), (free_func))&lt;br /&gt;
#define sk_BIO_dup(st)                  SKM_sk_dup(BIO, st)&lt;br /&gt;
&lt;br /&gt;
/* get &amp;amp; set */&lt;br /&gt;
#define sk_BIO_num(st)                  SKM_sk_num(BIO, (st))&lt;br /&gt;
#define sk_BIO_value(st, i)             SKM_sk_value(BIO, (st), (i))&lt;br /&gt;
#define sk_BIO_set(st, i, val)          SKM_sk_set(BIO, (st), (i), (val))&lt;br /&gt;
&lt;br /&gt;
/* add value */&lt;br /&gt;
#define sk_BIO_insert(st, val, i)       SKM_sk_insert(BIO, (st), (val), (i))&lt;br /&gt;
#define sk_BIO_push(st, val)            SKM_sk_push(BIO, (st), (val))&lt;br /&gt;
#define sk_BIO_unshift(st, val)         SKM_sk_unshift(BIO, (st), (val))&lt;br /&gt;
&lt;br /&gt;
/* sort &amp;amp; find */&lt;br /&gt;
#define sk_BIO_set_cmp_func(st, cmp)    SKM_sk_set_cmp_func(BIO, (st), (cmp))&lt;br /&gt;
#define sk_BIO_sort(st)                 SKM_sk_sort(BIO, (st))&lt;br /&gt;
#define sk_BIO_is_sorted(st)            SKM_sk_is_sorted(BIO, (st))&lt;br /&gt;
#define sk_BIO_find(st, val)            SKM_sk_find(BIO, (st), (val))&lt;br /&gt;
#define sk_BIO_find_ex(st, val)         SKM_sk_find_ex(BIO, (st), (val))&lt;br /&gt;
&lt;br /&gt;
/* delete value */&lt;br /&gt;
#define sk_BIO_delete(st, i)            SKM_sk_delete(BIO, (st), (i))&lt;br /&gt;
#define sk_BIO_delete_ptr(st, ptr)      SKM_sk_delete_ptr(BIO, (st), (ptr))&lt;br /&gt;
#define sk_BIO_pop(st)                  SKM_sk_pop(BIO, (st))&lt;br /&gt;
#define sk_BIO_shift(st)                SKM_sk_shift(BIO, (st))&lt;br /&gt;
#define sk_BIO_zero(st)                 SKM_sk_zero(BIO, (st))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Vincent</name></author>
	</entry>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=Main_Page&amp;diff=1406</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=Main_Page&amp;diff=1406"/>
		<updated>2014-01-13T21:31:24Z</updated>

		<summary type="html">&lt;p&gt;Vincent: add link to the STACK API page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If this is your first visit or to get an account please see the [[Welcome]] page. Your participation and [[Contributions]] are valued.&lt;br /&gt;
&lt;br /&gt;
This wiki is intended as a place for collecting, organizing, and refining useful information about OpenSSL that is currently strewn among multiple locations and formats.&lt;br /&gt;
&lt;br /&gt;
== OpenSSL Quick Links ==&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;TABLE border=0&amp;gt;&lt;br /&gt;
     &amp;lt;TR&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[OpenSSL Overview]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Image:HTAB.png]][[Image:HTAB.png]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Compilation and Installation]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Image:HTAB.png]][[Image:HTAB.png]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Internals]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Image:HTAB.png]][[Image:HTAB.png]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Mailing Lists]] &amp;lt;/TD&amp;gt;&lt;br /&gt;
      &amp;lt;/TR&amp;gt;&lt;br /&gt;
      &amp;lt;TR&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[libcrypto API]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Image:HTAB.png]][[Image:HTAB.png]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[libssl API]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Image:HTAB.png]][[Image:HTAB.png]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Examples]] &amp;lt;/TD&amp;gt;&lt;br /&gt;
      &amp;lt;/TR&amp;gt;&lt;br /&gt;
      &amp;lt;TR&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[License]] &amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Image:HTAB.png]][[Image:HTAB.png]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Command Line Utilities]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Image:HTAB.png]][[Image:HTAB.png]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
        &amp;lt;TD&amp;gt;[[Related Links]]&amp;lt;/TD&amp;gt;&lt;br /&gt;
      &amp;lt;/TR&amp;gt;&lt;br /&gt;
  &amp;lt;/TABLE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Administrivia ==&lt;br /&gt;
Site guidelines, legal and admininstrative issues.&lt;br /&gt;
:* [[Basic rules]], [[Commercial Product Disclaimer]], [[Contributions]], [[Copyright]], [[License]]&lt;br /&gt;
:* Using This Wiki&lt;br /&gt;
:: [http://meta.wikimedia.org/wiki/Help:Contents Wiki User's Guide], [http://www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list], [http://www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ], [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki Mailing List]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
This section contains the automagically generated man pages from the OpenSSL git repository, and similar &amp;quot;man&amp;quot; style reference documentation. The man pages are automatically imported from the OpenSSL git repository and local wiki modifications are submitted as patches.&lt;br /&gt;
:* OpenSSL Manual Pages&lt;br /&gt;
::* [[Manual:Openssl(1)]], [[Manual:Ssl(3)]], [[Manual:Crypto(3)]], [[Documentation Index]]&lt;br /&gt;
:: If you wish to edit any of the Manual page content please refer to the [[Guidelines for Manual Page Authors]] page.&lt;br /&gt;
:* [[API]], [[Libcrypto API]], [[Libssl API]]&lt;br /&gt;
:* [[FIPS mode()]], [[FIPS_mode_set()]]&lt;br /&gt;
&lt;br /&gt;
== Usage and Programming ==&lt;br /&gt;
This section has discussions of practical issues in using OpenSSL&lt;br /&gt;
:* Building from Source&lt;br /&gt;
:: Where to find it, the different versions, how to build and install it.&lt;br /&gt;
:* [[OpenSSL Overview]]&lt;br /&gt;
:* [[Versioning]]&lt;br /&gt;
:* [[Compilation and Installation]]&lt;br /&gt;
:* [[EVP]]&lt;br /&gt;
:: Programming techniques and example code&lt;br /&gt;
:: Use of EVP is preferred for most applications and circumstances&lt;br /&gt;
::* [[EVP Asymmetric Encryption and Decryption of an Envelope]]&lt;br /&gt;
::* [[EVP Authenticated Encryption and Decryption]]&lt;br /&gt;
::* [[EVP Symmetric Encryption and Decryption]]&lt;br /&gt;
::* [[EVP Key and Parameter Generation]]&lt;br /&gt;
::* [[EVP Key Agreement]]&lt;br /&gt;
::* [[EVP Message Digests]]&lt;br /&gt;
::* [[EVP Key Derivation]]&lt;br /&gt;
::* [[EVP Signing and Verifying|EVP Signing and Verifying (including MAC codes)]]&lt;br /&gt;
:* [[STACK API]]&lt;br /&gt;
:* Low Level APIs&lt;br /&gt;
:: More specialized non-EVP usage&lt;br /&gt;
::* [[Diffie-Hellman parameters]]&lt;br /&gt;
&lt;br /&gt;
== Concepts and Theory ==&lt;br /&gt;
Discussions of basic cryptographic theory and concepts&lt;br /&gt;
Discussions of common operational issues&lt;br /&gt;
:* [[Base64]]&lt;br /&gt;
:* [[FIPS 140-2]]&lt;br /&gt;
:* [[Random Numbers]]&lt;br /&gt;
:* [[Diffie Hellman]]&lt;br /&gt;
:* [[Elliptic Curve Diffie Hellman]]&lt;br /&gt;
:* [[Elliptic Curve Cryptography]]&lt;br /&gt;
&lt;br /&gt;
== Internals and Development ==&lt;br /&gt;
This section is for internal details of primary interest to OpenSSL maintainers and power users&lt;br /&gt;
:* [[Internals]]&lt;br /&gt;
:* [[Code Quality]]&lt;br /&gt;
:* [[Static and Dynamic Analysis]]&lt;br /&gt;
:* [[OCB|OCB Licence details]]&lt;/div&gt;</summary>
		<author><name>Vincent</name></author>
	</entry>
</feed>