xref: /onnv-gate/usr/src/common/openssl/crypto/opensslv.h (revision 0:68f95e015346)
1*0Sstevel@tonic-gate #ifndef HEADER_OPENSSLV_H
2*0Sstevel@tonic-gate #define HEADER_OPENSSLV_H
3*0Sstevel@tonic-gate 
4*0Sstevel@tonic-gate /* Numeric release version identifier:
5*0Sstevel@tonic-gate  * MNNFFPPS: major minor fix patch status
6*0Sstevel@tonic-gate  * The status nibble has one of the values 0 for development, 1 to e for betas
7*0Sstevel@tonic-gate  * 1 to 14, and f for release.  The patch level is exactly that.
8*0Sstevel@tonic-gate  * For example:
9*0Sstevel@tonic-gate  * 0.9.3-dev	  0x00903000
10*0Sstevel@tonic-gate  * 0.9.3-beta1	  0x00903001
11*0Sstevel@tonic-gate  * 0.9.3-beta2-dev 0x00903002
12*0Sstevel@tonic-gate  * 0.9.3-beta2    0x00903002 (same as ...beta2-dev)
13*0Sstevel@tonic-gate  * 0.9.3	  0x0090300f
14*0Sstevel@tonic-gate  * 0.9.3a	  0x0090301f
15*0Sstevel@tonic-gate  * 0.9.4 	  0x0090400f
16*0Sstevel@tonic-gate  * 1.2.3z	  0x102031af
17*0Sstevel@tonic-gate  *
18*0Sstevel@tonic-gate  * For continuity reasons (because 0.9.5 is already out, and is coded
19*0Sstevel@tonic-gate  * 0x00905100), between 0.9.5 and 0.9.6 the coding of the patch level
20*0Sstevel@tonic-gate  * part is slightly different, by setting the highest bit.  This means
21*0Sstevel@tonic-gate  * that 0.9.5a looks like this: 0x0090581f.  At 0.9.6, we can start
22*0Sstevel@tonic-gate  * with 0x0090600S...
23*0Sstevel@tonic-gate  *
24*0Sstevel@tonic-gate  * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.)
25*0Sstevel@tonic-gate  * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
26*0Sstevel@tonic-gate  *  major minor fix final patch/beta)
27*0Sstevel@tonic-gate  */
28*0Sstevel@tonic-gate #define OPENSSL_VERSION_NUMBER	0x0090704fL
29*0Sstevel@tonic-gate #define OPENSSL_VERSION_TEXT	"OpenSSL 0.9.7d 17 Mar 2004"
30*0Sstevel@tonic-gate #define OPENSSL_VERSION_PTEXT	" part of " OPENSSL_VERSION_TEXT
31*0Sstevel@tonic-gate 
32*0Sstevel@tonic-gate 
33*0Sstevel@tonic-gate /* The macros below are to be used for shared library (.so, .dll, ...)
34*0Sstevel@tonic-gate  * versioning.  That kind of versioning works a bit differently between
35*0Sstevel@tonic-gate  * operating systems.  The most usual scheme is to set a major and a minor
36*0Sstevel@tonic-gate  * number, and have the runtime loader check that the major number is equal
37*0Sstevel@tonic-gate  * to what it was at application link time, while the minor number has to
38*0Sstevel@tonic-gate  * be greater or equal to what it was at application link time.  With this
39*0Sstevel@tonic-gate  * scheme, the version number is usually part of the file name, like this:
40*0Sstevel@tonic-gate  *
41*0Sstevel@tonic-gate  *	libcrypto.so.0.9
42*0Sstevel@tonic-gate  *
43*0Sstevel@tonic-gate  * Some unixen also make a softlink with the major verson number only:
44*0Sstevel@tonic-gate  *
45*0Sstevel@tonic-gate  *	libcrypto.so.0
46*0Sstevel@tonic-gate  *
47*0Sstevel@tonic-gate  * On Tru64 and IRIX 6.x it works a little bit differently.  There, the
48*0Sstevel@tonic-gate  * shared library version is stored in the file, and is actually a series
49*0Sstevel@tonic-gate  * of versions, separated by colons.  The rightmost version present in the
50*0Sstevel@tonic-gate  * library when linking an application is stored in the application to be
51*0Sstevel@tonic-gate  * matched at run time.  When the application is run, a check is done to
52*0Sstevel@tonic-gate  * see if the library version stored in the application matches any of the
53*0Sstevel@tonic-gate  * versions in the version string of the library itself.
54*0Sstevel@tonic-gate  * This version string can be constructed in any way, depending on what
55*0Sstevel@tonic-gate  * kind of matching is desired.  However, to implement the same scheme as
56*0Sstevel@tonic-gate  * the one used in the other unixen, all compatible versions, from lowest
57*0Sstevel@tonic-gate  * to highest, should be part of the string.  Consecutive builds would
58*0Sstevel@tonic-gate  * give the following versions strings:
59*0Sstevel@tonic-gate  *
60*0Sstevel@tonic-gate  *	3.0
61*0Sstevel@tonic-gate  *	3.0:3.1
62*0Sstevel@tonic-gate  *	3.0:3.1:3.2
63*0Sstevel@tonic-gate  *	4.0
64*0Sstevel@tonic-gate  *	4.0:4.1
65*0Sstevel@tonic-gate  *
66*0Sstevel@tonic-gate  * Notice how version 4 is completely incompatible with version, and
67*0Sstevel@tonic-gate  * therefore give the breach you can see.
68*0Sstevel@tonic-gate  *
69*0Sstevel@tonic-gate  * There may be other schemes as well that I haven't yet discovered.
70*0Sstevel@tonic-gate  *
71*0Sstevel@tonic-gate  * So, here's the way it works here: first of all, the library version
72*0Sstevel@tonic-gate  * number doesn't need at all to match the overall OpenSSL version.
73*0Sstevel@tonic-gate  * However, it's nice and more understandable if it actually does.
74*0Sstevel@tonic-gate  * The current library version is stored in the macro SHLIB_VERSION_NUMBER,
75*0Sstevel@tonic-gate  * which is just a piece of text in the format "M.m.e" (Major, minor, edit).
76*0Sstevel@tonic-gate  * For the sake of Tru64, IRIX, and any other OS that behaves in similar ways,
77*0Sstevel@tonic-gate  * we need to keep a history of version numbers, which is done in the
78*0Sstevel@tonic-gate  * macro SHLIB_VERSION_HISTORY.  The numbers are separated by colons and
79*0Sstevel@tonic-gate  * should only keep the versions that are binary compatible with the current.
80*0Sstevel@tonic-gate  */
81*0Sstevel@tonic-gate #define SHLIB_VERSION_HISTORY ""
82*0Sstevel@tonic-gate #define SHLIB_VERSION_NUMBER "0.9.7"
83*0Sstevel@tonic-gate 
84*0Sstevel@tonic-gate 
85*0Sstevel@tonic-gate #endif /* HEADER_OPENSSLV_H */
86