CHANGES 196 KB
Newer Older
 OpenSSL CHANGES
 Changes between 0.9.6 and 0.9.7  [xx XXX 2000]
Dr. Stephen Henson's avatar
 
Dr. Stephen Henson committed
  *) Allow multiple 'certopt' and 'nameopt' options to be separated
     by commas. Add 'namopt' and 'certopt' options to the 'ca' config
     file: this allows the display of the certificate about to be
     signed to be customised, to allow certain fields to be included
     or excluded and extension details. The old system didn't display
     multicharacter strings properly, omitted fields not in the policy
     and couldn't display additional details such as extensions.
     [Steve Henson]

  *) Fix memory leaks in err.c: free err_data string if necessary;
     don't write to the wrong index in ERR_set_error_data.
Bodo Möller's avatar
Bodo Möller committed
     [Bodo Moeller]

  *) Function EC_POINTs_mul for simultaneous scalar multiplication
     of an arbitrary number of elliptic curve points, optionally
     including the generator defined for the EC_GROUP.
     EC_POINT_mul is a simple wrapper function for the typical case
     that the point list has just one item (besides the optional
     generator).
     [Bodo Moeller]

  *) First EC_METHODs for curves over GF(p):

     EC_GFp_simple_method() uses the basic BN_mod_mul and BN_mod_sqr
     operations and provides various method functions that can also
     operate with faster implementations of modular arithmetic.     

     EC_GFp_mont_method() reuses most functions that are part of
     EC_GFp_simple_method, but uses Montgomery arithmetic.

     [Bodo Moeller; point addition and point doubling
     implementation directly derived from source code provided by
     Lenka Fibikova <fibikova@exp-math.uni-essen.de>]

  *) Framework for elliptic curves (crypto/ec/ec.h, crypto/ec/ec_lcl.h,
     crypto/ec/ec_lib.c):

     Curves are EC_GROUP objects (with an optional group generator)
     based on EC_METHODs that are built into the library.

     Points are EC_POINT objects based on EC_GROUP objects.

     Most of the framework would be able to handle curves over arbitrary
     finite fields, but as there are no obvious types for fields other
     than GF(p), some functions are limited to that for now.
  *) Add the -HTTP option to s_server.  It is similar to -WWW, but requires
     that the file contains a complete HTTP response.
     [Richard Levitte]

Dr. Stephen Henson's avatar
 
Dr. Stephen Henson committed
  *) Add the ec directory to mkdef.pl and mkfiles.pl. In mkdef.pl
     change the def and num file printf format specifier from "%-40sXXX"
     to "%-39s XXX". The latter will always guarantee a space after the
     field while the former will cause them to run together if the field
     is 40 of more characters long.
     [Steve Henson]

Dr. Stephen Henson's avatar
 
Dr. Stephen Henson committed
  *) Constify the cipher and digest 'method' functions and structures
     and modify related functions to take constant EVP_MD and EVP_CIPHER
     pointers.
     [Steve Henson]

Bodo Möller's avatar
Bodo Möller committed
  *) Implement ssl23_peek (analogous to ssl23_read), which previously
     did not exist.
     [Bodo Moeller]

  *) Replace rdtsc with _emit statements for VC++ version 5.
     [Jeremy Cooper <jeremy@baymoo.org>]
  *) Hide BN_CTX structure details in bn_lcl.h instead of publishing them
     in <openssl/bn.h>.  Also further increase BN_CTX_NUM to 32.
     [Bodo Moeller]

Dr. Stephen Henson's avatar
 
Dr. Stephen Henson committed
  *) Modify EVP_Digest*() routines so they now return values. Although the
     internal software routines can never fail additional hardware versions
     might.
     [Steve Henson]

Bodo Möller's avatar
Bodo Möller committed
  *) Clean up crypto/err/err.h and change some error codes to avoid conflicts:

     Previously ERR_R_FATAL was too small and coincided with ERR_LIB_PKCS7
     (= ERR_R_PKCS7_LIB); it is now 64 instead of 32.

     ASN1 error codes
          ERR_R_NESTED_ASN1_ERROR
          ...
          ERR_R_MISSING_ASN1_EOS
     were 4 .. 9, conflicting with
          ERR_LIB_RSA (= ERR_R_RSA_LIB)
          ...
          ERR_LIB_PEM (= ERR_R_PEM_LIB).
     They are now 58 .. 63 (i.e., just below ERR_R_FATAL).

     Add new error code 'ERR_R_INTERNAL_ERROR'.
     [Bodo Moeller]

  *) Don't overuse locks in crypto/err/err.c: For data retrieval, CRYPTO_r_lock
     suffices.
     [Bodo Moeller]

  *) New option '-subj arg' for 'openssl req' and 'openssl ca'.  This
     sets the subject name for a new request or supersedes the
     subject name in a given request. Formats that can be parsed are
          'CN=Some Name, OU=myOU, C=IT'
     and
          'CN=Some Name/OU=myOU/C=IT'.

     Add options '-batch' and '-verbose' to 'openssl req'.
     [Massimiliano Pala <madwolf@hackmasters.net>]

  *) Make it possible to reuse SSLv2 sessions.
     [Richard Levitte]

  *) Introduce the possibility to access global variables through
     functions on platform were that's the best way to handle exporting
     global variables in shared libraries.  To enable this functionality,
     one must configure with "EXPORT_VAR_AS_FN" or defined the C macro
     "OPENSSL_EXPORT_VAR_AS_FUNCTION" in crypto/opensslconf.h (the latter
     is normally done by Configure or something similar).

     To implement a global variable, use the macro OPENSSL_IMPLEMENT_GLOBAL
     in the source file (foo.c) like this:

	OPENSSL_IMPLEMENT_GLOBAL(int,foo)=1;
	OPENSSL_IMPLEMENT_GLOBAL(double,bar);

     To declare a global variable, use the macros OPENSSL_DECLARE_GLOBAL
     and OPENSSL_GLOBAL_REF in the header file (foo.h) like this:

	OPENSSL_DECLARE_GLOBAL(int,foo);
	#define foo OPENSSL_GLOBAL_REF(foo)
	OPENSSL_DECLARE_GLOBAL(double,bar);
	#define bar OPENSSL_GLOBAL_REF(bar)

     The #defines are very important, and therefore so is including the
     header file everywere where the defined globals are used.

     The macro OPENSSL_EXPORT_VAR_AS_FUNCTION also affects the definition
     of ASN.1 items, but that structure is a bt different.

     The largest change is in util/mkdef.pl which has been enhanced with
     better and easier to understand logic to choose which symbols should
     go into the Windows .def files as well as a number of fixes and code
     cleanup (among others, algorithm keywords are now sorted
     lexicographically to avoid constant rewrites).
     [Richard Levitte]

Dr. Stephen Henson's avatar
 
Dr. Stephen Henson committed
  *) In copy_email() check for >= 0 as a return value for
     X509_NAME_get_index_by_NID() since 0 is a valid index.
     [Steve Henson reported by Massimiliano Pala <madwolf@opensca.org>]

Dr. Stephen Henson's avatar
 
Dr. Stephen Henson committed
  *) In BN_div() keep a copy of the sign of 'num' before writing the
     result to 'rm' because if rm==num the value will be overwritten
     and produce the wrong result if 'num' is negative: this caused
     problems with BN_mod() and BN_nnmod().
     [Steve Henson]

Dr. Stephen Henson's avatar
 
Dr. Stephen Henson committed
  *) Function OCSP_request_verify(). This checks the signature on an
     OCSP request and verifies the signer certificate. The signer
     certificate is just checked for a generic purpose and OCSP request
     trust settings.
     [Steve Henson]

  *) Add OCSP_check_validity() function to check the validity of OCSP
     responses. OCSP responses are prepared in real time and may only
     be a few seconds old. Simply checking that the current time lies
     between thisUpdate and nextUpdate max reject otherwise valid responses
     caused by either OCSP responder or client clock innacuracy. Instead
     we allow thisUpdate and nextUpdate to fall within a certain period of
     the current time. The age of the response can also optionally be
     checked. Two new options -validity_period and -status_age added to
     ocsp utility.
     [Steve Henson]

Dr. Stephen Henson's avatar
 
Dr. Stephen Henson committed
  *) If signature or public key algorithm is unrecognized print out its
     OID rather that just UNKOWN.
     [Steve Henson]

  *) Avoid coredump with unsupported or invalid public keys by checking if
     X509_get_pubkey() fails in PKCS7_verify(). Fix memory leak when
     PKCS7_verify() fails with non detached data.
     [Steve Henson]

  *) Change OCSP_cert_to_id() to tolerate a NULL subject certificate and
     OCSP_cert_id_new() a NULL serialNumber. This allows a partial certificate
     ID to be generated from the issuer certificate alone which can then be
     passed to OCSP_id_issuer_cmp().
     [Steve Henson]

  *) New compilation option ASN1_ITEM_FUNCTIONS. This causes the new
     ASN1 modules to export functions returning ASN1_ITEM pointers
     instead of the ASN1_ITEM structures themselves. This adds several
     new macros which allow the underlying ASN1 function/structure to
     be accessed transparently. As a result code should not use ASN1_ITEM
     references directly (such as &X509_it) but instead use the relevant
     macros (such as ASN1_ITEM_rptr(X509)). This option is to allow
     use of the new ASN1 code on platforms where exporting structures
     is problematical (for example in shared libraries) but exporting
     functions returning pointers to structures is not.
     [Steve Henson]

  *) Add support for overriding the generation of SSL/TLS session IDs.
     These callbacks can be registered either in an SSL_CTX or per SSL.
     The purpose of this is to allow applications to control, if they wish,
     the arbitrary values chosen for use as session IDs, particularly as it
     can be useful for session caching in multiple-server environments. A
     command-line switch for testing this (and any client code that wishes
     to use such a feature) has been added to "s_server".
     [Geoff Thorpe, Lutz Jaenicke]

  *) Modify mkdef.pl to recognise and parse prprocessor conditionals
     of the form '#if defined(...) || defined(...) || ...' and
     '#if !defined(...) && !defined(...) && ...'.  This also avoids
     the growing number of special cases it was previously handling.
     [Richard Levitte]

Ulf Möller's avatar
Ulf Möller committed
  *) Don't use getenv in library functions when run as setuid/setgid.
     New function OPENSSL_issetugid().
     [Ulf Moeller]

  *) Make all configuration macros available for application by making
     sure they are available in opensslconf.h, by giving them names starting
     with "OPENSSL_" to avoid conflicts with other packages and by making
     sure e_os2.h will cover all platform-specific cases together with
     opensslconf.h.
     Additionally, it is now possible to define configuration/platform-
     specific names (called "system identities").  In the C code, these
     are prefixed with "OPENSSL_SYSNAME_".  e_os2.h will create another
     macro with the name beginning with "OPENSSL_SYS_", which is determined
     from "OPENSSL_SYSNAME_*" or compiler-specific macros depending on
     what is available.
  *) New option -set_serial to 'req' and 'x509' this allows the serial
     number to use to be specified on the command line. Previously self
     signed certificates were hard coded with serial number 0 and the 
     CA options of 'x509' had to use a serial number in a file which was
     auto incremented.
     [Steve Henson]

  *) Avoid false positives in memory leak detection code (crypto/mem_dbg.c)
     due to incorrect handling of multi-threading:

     1. Fix timing glitch in the MemCheck_off() portion of CRYPTO_mem_ctrl().

     2. Fix logical glitch in is_MemCheck_on() aka CRYPTO_is_mem_check_on().

     3. Count how many times MemCheck_off() has been called so that
        nested use can be treated correctly.  This also avoids 
        inband-signalling in the previous code (which relied on the
        assumption that thread ID 0 is impossible).
     [Bodo Moeller]

  *) New options to 'ca' utility to support V2 CRL entry extensions.
     Currently CRL reason, invalidity date and hold instruction are
     supported. Add new CRL extensions to V3 code and some new objects.
     [Steve Henson]

  *) Add "-rand" option also to s_client and s_server.
     [Lutz Jaenicke]

  *) New function EVP_CIPHER_CTX_set_padding() this is used to
     disable standard block padding (aka PKCS#5 padding) in the EVP
     API, which was previously mandatory. This means that the data is
     not padded in any way and so the total length much be a multiple
     of the block size, otherwise an error occurs.
     [Steve Henson]

  *) Initial (incomplete) OCSP SSL support.
     [Steve Henson]

Ulf Möller's avatar
Ulf Möller committed
  *) Fix CPU detection on Irix 6.x.
     [Kurt Hockenbury <khockenb@stevens-tech.edu> and
      "Bruce W. Forsberg" <bruce.forsberg@baesystems.com>]

  *) New function OCSP_parse_url(). This splits up a URL into its host,
     port and path components: primarily to parse OCSP URLs. New -url
     option to ocsp utility.
     [Steve Henson]

  *) New nonce behavior. The return value of OCSP_check_nonce() now 
     reflects the various checks performed. Applications can decide
     whether to tolerate certain situations such as an absent nonce
     in a response when one was present in a request: the ocsp application
     just prints out a warning. New function OCSP_add1_basic_nonce()
     this is to allow responders to include a nonce in a response even if
     the request is nonce-less.
     [Steve Henson]

  *) Use the cached encoding of an X509_NAME structure rather than
     copying it. This is apparently the reason for the libsafe "errors"
     but the code is actually correct.
     [Steve Henson]

  *) Disable stdin buffering in load_cert (apps/apps.c) so that no certs are
     skipped when using openssl x509 multiple times on a single input file,
     e.g. "(openssl x509 -out cert1; openssl x509 -out cert2) <certs".
     [Bodo Moeller]

Dr. Stephen Henson's avatar
 
Dr. Stephen Henson committed
  *) Make ASN1_UTCTIME_set_string() and ASN1_GENERALIZEDTIME_set_string()
     set string type: to handle setting ASN1_TIME structures. Fix ca
     utility to correctly initialize revocation date of CRLs.
     [Steve Henson]

  *) New option SSL_OP_CIPHER_SERVER_PREFERENCE allows the server to override
     the clients preferred ciphersuites and rather use its own preferences.
     Should help to work around M$ SGC (Server Gated Cryptography) bug in
     Internet Explorer by ensuring unchanged hash method during stepup.
     [Lutz Jaenicke]

  *) Make mkdef.pl recognise all DECLARE_ASN1 macros, change rijndael
     to aes and add a new 'exist' option to print out symbols that don't
     appear to exist.
     [Steve Henson]

  *) Additional options to ocsp utility to allow flags to be set and
     additional certificates supplied.
     [Steve Henson]

  *) Add the option -VAfile to 'openssl ocsp', so the user can give the
     OCSP client a number of certificate to only verify the response
     signature against.
     [Richard Levitte]

Ulf Möller's avatar
Ulf Möller committed
  *) Add new function BN_rand_range(), and fix DSA_sign_setup() to prevent
     Bleichenbacher's DSA attack.
     Extend BN_[pseudo_]rand: As before, top=1 forces the highest two bits
     to be set and top=0 forces the highest bit to be set; top=-1 is new
     and leaves the highest bit random.
     [Ulf Moeller, Bodo Moeller]
Dr. Stephen Henson's avatar
 
Dr. Stephen Henson committed
  *) Update Rijndael code to version 3.0 and change EVP AES ciphers to
     handle the new API. Currently only ECB, CBC modes supported. Add new
     AES OIDs. Add TLS AES ciphersuites as described in the "AES Ciphersuites
     for TLS" draft-ietf-tls-ciphersuite-03.txt.
     [Ben Laurie, Steve Henson]

  *) In the NCONF_...-based implementations for CONF_... queries
     (crypto/conf/conf_lib.c), if the input LHASH is NULL, avoid using
     a temporary CONF structure with the data component set to NULL
     (which gives segmentation faults in lh_retrieve).
     Instead, use NULL for the CONF pointer in CONF_get_string and
     CONF_get_number (which may use environment variables) and directly
     return NULL from CONF_get_section.
     [Bodo Moeller]

  *) Fix potential buffer overrun for EBCDIC.
     [Ulf Moeller]

  *) New function OCSP_copy_nonce() to copy nonce value (if present) from
     request to response.
     [Steve Henson]

Dr. Stephen Henson's avatar
 
Dr. Stephen Henson committed
  *) Functions for OCSP responders. OCSP_request_onereq_count(),
     OCSP_request_onereq_get0(), OCSP_onereq_get0_id() and OCSP_id_get0_info()
     extract information from a certificate request. OCSP_response_create()
     creates a response and optionally adds a basic response structure.
     OCSP_basic_add1_status() adds a complete single response to a basic
     reponse and returns the OCSP_SINGLERESP structure just added (to allow
     extensions to be included for example). OCSP_basic_add1_cert() adds a
     certificate to a basic response and OCSP_basic_sign() signs a basic
     response with various flags. New helper functions ASN1_TIME_check()
     (checks validity of ASN1_TIME structure) and ASN1_TIME_to_generalizedtime()
     (converts ASN1_TIME to GeneralizedTime).
     [Steve Henson]

  *) Various new functions. EVP_Digest() combines EVP_Digest{Init,Update,Final}()
     in a single operation. X509_get0_pubkey_bitstr() extracts the public_key
     structure from a certificate. X509_pubkey_digest() digests tha public_key
     contents: this is used in various key identifiers. 
     [Steve Henson]

  *) Tolerate nonRepudiation as being valid for S/MIME signing and certSign
     keyUsage if basicConstraints absent for a CA.
     [Steve Henson]

Richard Levitte's avatar
Richard Levitte committed
  *) Make SMIME_write_PKCS7() write mail header values with a format that
     is more generally accepted (no spaces before the semicolon), since
     some programs can't parse those values properly otherwise.  Also make
     sure BIO's that break lines after each write do not create invalid
     headers.
     [Richard Levitte]

  *) Make sk_sort() tolerate a NULL argument.
     [Steve Henson reported by Massimiliano Pala <madwolf@comune.modena.it>]

  *) New OCSP verify flag OCSP_TRUSTOTHER. When set the "other" certificates
     passed by the function are trusted implicitly. If any of them signed the
     reponse then it is assumed to be valid and is not verified.
     [Steve Henson]

  *) Zero the premaster secret after deriving the master secret in
     DH ciphersuites.
     [Steve Henson]

  *) In PKCS7_set_type() initialise content_type in PKCS7_ENC_CONTENT
     to data. This was previously part of the PKCS7 ASN1 code. This
     was causing problems with OpenSSL created PKCS#12 and PKCS#7 structures.
     [Steve Henson, reported by Kenneth R. Robinette
				<support@securenetterm.com>]

  *) Add CRYPTO_push_info() and CRYPTO_pop_info() calls to new ASN1
     routines: without these tracing memory leaks is very painful.
     Fix leaks in PKCS12 and PKCS7 routines.
     [Steve Henson]

  *) Fix for Irix with NO_ASM.
     ["Bruce W. Forsberg" <bruce.forsberg@baesystems.com>]

  *) Add some EVP_add_digest_alias registrations (as found in
     OpenSSL_add_all_digests()), to SSL_library_init()
     aka OpenSSL_add_ssl_algorithms().  This provides improved
     compatibility with peers using X.509 certificates
     with unconventional AlgorithmIdentifier OIDs.
     [Bodo Moeller]

  *) ./config script fixes.
     [Ulf Moeller, Richard Levitte]

  *) Make X509_time_adj() cope with the new behaviour of ASN1_TIME_new().
     Previously it initialised the 'type' argument to V_ASN1_UTCTIME which
     effectively meant GeneralizedTime would never be used. Now it
     is initialised to -1 but X509_time_adj() now has to check the value
     and use ASN1_TIME_set() if the value is not V_ASN1_UTCTIME or
     V_ASN1_GENERALIZEDTIME, without this it always uses GeneralizedTime.
     [Steve Henson, reported by Kenneth R. Robinette
				<support@securenetterm.com>]

  *) Fixes to BN_to_ASN1_INTEGER when bn is zero. This would previously
     result in a zero length in the ASN1_INTEGER structure which was
     not consistent with the structure when d2i_ASN1_INTEGER() was used
     and would cause ASN1_INTEGER_cmp() to fail. Enhance s2i_ASN1_INTEGER()
     to cope with hex and negative integers. Fix bug in i2a_ASN1_INTEGER()
     where it did not print out a minus for negative ASN1_INTEGER.
     [Steve Henson]

Bodo Möller's avatar
Bodo Möller committed
  *) Fix 'openssl passwd -1'.
     [Bodo Moeller]

  *) Add summary printout to ocsp utility. The various functions which
     convert status values to strings have been renamed to:
     OCSP_response_status_str(), OCSP_cert_status_str() and
     OCSP_crl_reason_str() and are no longer static. New options
     to verify nonce values and to disable verification. OCSP response
     printout format cleaned up.
     [Steve Henson]

  *) Add additional OCSP certificate checks. These are those specified
     in RFC2560. This consists of two separate checks: the CA of the
     certificate being checked must either be the OCSP signer certificate
     or the issuer of the OCSP signer certificate. In the latter case the
     OCSP signer certificate must contain the OCSP signing extended key
     usage. This check is performed by attempting to match the OCSP
     signer or the OCSP signer CA to the issuerNameHash and issuerKeyHash
     in the OCSP_CERTID structures of the response.
     [Steve Henson]

Dr. Stephen Henson's avatar
 
Dr. Stephen Henson committed
  *) Initial OCSP certificate verification added to OCSP_basic_verify()
     and related routines. This uses the standard OpenSSL certificate
     verify routines to perform initial checks (just CA validity) and
     to obtain the certificate chain. Then additional checks will be
     performed on the chain. Currently the root CA is checked to see
     if it is explicitly trusted for OCSP signing. This is used to set
     a root CA as a global signing root: that is any certificate that
     chains to that CA is an acceptable OCSP signing certificate.
     [Steve Henson]

  *) New '-extfile ...' option to 'openssl ca' for reading X.509v3
     extensions from a separate configuration file.
     As when reading extensions from the main configuration file,
     the '-extensions ...' option may be used for specifying the
     section to use.
     [Massimiliano Pala <madwolf@comune.modena.it>]

  *) Change PKCS12_key_gen_asc() so it can cope with non null
     terminated strings whose length is passed in the passlen
     parameter, for example from PEM callbacks. This was done
     by adding an extra length parameter to asc2uni().
     [Steve Henson, reported by <oddissey@samsung.co.kr>]

Dr. Stephen Henson's avatar
 
Dr. Stephen Henson committed
  *) New OCSP utility. Allows OCSP requests to be generated or
     read. The request can be sent to a responder and the output
     parsed, outputed or printed in text form. Not complete yet:
     still needs to check the OCSP response validity.
     [Steve Henson]

  *) New subcommands for 'openssl ca':
     'openssl ca -status <serial>' prints the status of the cert with
     the given serial number (according to the index file).
     'openssl ca -updatedb' updates the expiry status of certificates
     in the index file.
     [Massimiliano Pala <madwolf@comune.modena.it>]

  *) New '-newreq-nodes' command option to CA.pl.  This is like
     '-newreq', but calls 'openssl req' with the '-nodes' option
     so that the resulting key is not encrypted.
     [Damien Miller <djm@mindrot.org>]

  *) New configuration for the GNU Hurd.
     [Jonathan Bartlett <johnnyb@wolfram.com> via Richard Levitte]

Dr. Stephen Henson's avatar
 
Dr. Stephen Henson committed
  *) Initial code to implement OCSP basic response verify. This
     is currently incomplete. Currently just finds the signer's
     certificate and verifies the signature on the response.
     [Steve Henson]

  *) New SSLeay_version code SSLEAY_DIR to determine the compiled-in
     value of OPENSSLDIR.  This is available via the new '-d' option
     to 'openssl version', and is also included in 'openssl version -a'.
     [Bodo Moeller]

  *) Fix C code generated by 'openssl dsaparam -C': If a BN_bin2bn
     call failed, free the DSA structure.
     [Bodo Moeller]

  *) Allowing defining memory allocation callbacks that will be given
     file name and line number information in additional arguments
     (a const char* and an int).  The basic functionality remains, as
     well as the original possibility to just replace malloc(),
     realloc() and free() by functions that do not know about these
     additional arguments.  To register and find out the current
     settings for extended allocation functions, the following
     functions are provided:

	CRYPTO_set_mem_ex_functions
	CRYPTO_set_locked_mem_ex_functions
	CRYPTO_get_mem_ex_functions
	CRYPTO_get_locked_mem_ex_functions

     These work the same way as CRYPTO_set_mem_functions and friends.
     CRYPTO_get_[locked_]mem_functions now writes 0 where such an
     extended allocation function is enabled.
     Similarly, CRYPTO_get_[locked_]mem_ex_functions writes 0 where
     a conventional allocation function is enabled.
     [Richard Levitte, Bodo Moeller]
  *) Fix to uni2asc() to cope with zero length Unicode strings.
     These are present in some PKCS#12 files.
     [Steve Henson]

  *) Finish off removing the remaining LHASH function pointer casts.
     There should no longer be any prototype-casting required when using
     the LHASH abstraction, and any casts that remain are "bugs". See
     the callback types and macros at the head of lhash.h for details
     (and "OBJ_cleanup" in crypto/objects/obj_dat.c as an example).
  *) Add automatic query of EGD sockets in RAND_poll() for the unix variant.
     If an EGD or PRNGD is running and enough entropy is returned, automatic
     seeding like with /dev/[u]random will be performed.
     Positions tried are: /etc/entropy, /var/run/egd-pool.
     [Lutz Jaenicke]

  *) Change the Unix RAND_poll() variant to be able to poll several
     random devices, as specified by DEVRANDOM, until a sufficient amount
     of data has been collected.   We spend at most 10 ms on each file
     (select timeout) and read in non-blocking mode.  DEVRANDOM now
     defaults to the list "/dev/urandom", "/dev/random", "/dev/srandom"
     (previously it was just the string "/dev/urandom"), so on typical
     platforms the 10 ms delay will never occur.
     Also separate out the Unix variant to its own file, rand_unix.c.
     For VMS, there's a currently-empty rand_vms.c.
Dr. Stephen Henson's avatar
 
Dr. Stephen Henson committed
  *) Move OCSP client related routines to ocsp_cl.c. These
     provide utility functions which an application needing
     to issue a request to an OCSP responder and analyse the
     response will typically need: as opposed to those which an
     OCSP responder itself would need which will be added later.

     OCSP_request_sign() signs an OCSP request with an API similar
     to PKCS7_sign(). OCSP_response_status() returns status of OCSP
     response. OCSP_response_get1_basic() extracts basic response
     from response. OCSP_resp_find_status(): finds and extracts status
     information from an OCSP_CERTID structure (which will be created
     when the request structure is built). These are built from lower
     level functions which work on OCSP_SINGLERESP structures but
     wont normally be used unless the application wishes to examine
     extensions in the OCSP response for example.

     Replace nonce routines with a pair of functions.
     OCSP_request_add1_nonce() adds a nonce value and optionally
     generates a random value. OCSP_check_nonce() checks the
     validity of the nonce in an OCSP response.
     [Steve Henson]

  *) Change function OCSP_request_add() to OCSP_request_add0_id().
     This doesn't copy the supplied OCSP_CERTID and avoids the
     need to free up the newly created id. Change return type
     to OCSP_ONEREQ to return the internal OCSP_ONEREQ structure.
     This can then be used to add extensions to the request.
     Deleted OCSP_request_new(), since most of its functionality
     is now in OCSP_REQUEST_new() (and the case insensitive name
     clash) apart from the ability to set the request name which
     will be added elsewhere.
     [Steve Henson]

Dr. Stephen Henson's avatar
Dr. Stephen Henson committed
  *) Update OCSP API. Remove obsolete extensions argument from
     various functions. Extensions are now handled using the new
     OCSP extension code. New simple OCSP HTTP function which 
     can be used to send requests and parse the response.
     [Steve Henson]

  *) Fix the PKCS#7 (S/MIME) code to work with new ASN1. Two new
     ASN1_ITEM structures help with sign and verify. PKCS7_ATTR_SIGN
     uses the special reorder version of SET OF to sort the attributes
     and reorder them to match the encoded order. This resolves a long
     standing problem: a verify on a PKCS7 structure just after signing
     it used to fail because the attribute order did not match the
     encoded order. PKCS7_ATTR_VERIFY does not reorder the attributes:
     it uses the received order. This is necessary to tolerate some broken
     software that does not order SET OF. This is handled by encoding
     as a SEQUENCE OF but using implicit tagging (with UNIVERSAL class)
     to produce the required SET OF.
     [Steve Henson]

Richard Levitte's avatar
Richard Levitte committed
  *) Have mk1mf.pl generate the macros OPENSSL_BUILD_SHLIBCRYPTO and
     OPENSSL_BUILD_SHLIBSSL and use them appropriately in the header
     files to get correct declarations of the ASN.1 item variables.
     [Richard Levitte]

Dr. Stephen Henson's avatar
 
Dr. Stephen Henson committed
  *) Rewrite of PKCS#12 code to use new ASN1 functionality. Replace many
     PKCS#12 macros with real functions. Fix two unrelated ASN1 bugs:
     asn1_check_tlen() would sometimes attempt to use 'ctx' when it was
     NULL and ASN1_TYPE was not dereferenced properly in asn1_ex_c2i().
     New ASN1 macro: DECLARE_ASN1_ITEM() which just declares the relevant
     ASN1_ITEM and no wrapper functions.
     [Steve Henson]

  *) New functions or ASN1_item_d2i_fp() and ASN1_item_d2i_bio(). These
     replace the old function pointer based I/O routines. Change most of
     the *_d2i_bio() and *_d2i_fp() functions to use these.
     [Steve Henson]

  *) Enhance mkdef.pl to be more accepting about spacing in C preprocessor
     lines, recognice more "algorithms" that can be deselected, and make
     it complain about algorithm deselection that isn't recognised.
     [Richard Levitte]

  *) New ASN1 functions to handle dup, sign, verify, digest, pack and
     unpack operations in terms of ASN1_ITEM. Modify existing wrappers
     to use new functions. Add NO_ASN1_OLD which can be set to remove
     some old style ASN1 functions: this can be used to determine if old
     code will still work when these eventually go away.
  *) New extension functions for OCSP structures, these follow the
     same conventions as certificates and CRLs.
     [Steve Henson]

  *) New function X509V3_add1_i2d(). This automatically encodes and
     adds an extension. Its behaviour can be customised with various
     flags to append, replace or delete. Various wrappers added for
     certifcates and CRLs.
     [Steve Henson]

Dr. Stephen Henson's avatar
 
Dr. Stephen Henson committed
  *) Fix to avoid calling the underlying ASN1 print routine when
     an extension cannot be parsed. Correct a typo in the
     OCSP_SERVICELOC extension. Tidy up print OCSP format.
     [Steve Henson]

  *) Increase s2->wbuf allocation by one byte in ssl2_new (ssl/s2_lib.c).
     Otherwise do_ssl_write (ssl/s2_pkt.c) will write beyond buffer limits
     when writing a 32767 byte record.
     [Bodo Moeller; problem reported by Eric Day <eday@concentric.net>]

  *) In RSA_eay_public_{en,ed}crypt and RSA_eay_mod_exp (rsa_eay.c),
     obtain lock CRYPTO_LOCK_RSA before setting rsa->_method_mod_{n,p,q}.

     (RSA objects have a reference count access to which is protected
     by CRYPTO_LOCK_RSA [see rsa_lib.c, s3_srvr.c, ssl_cert.c, ssl_rsa.c],
     so they are meant to be shared between threads.)
     [Bodo Moeller, Geoff Thorpe; original patch submitted by
     "Reddie, Steven" <Steven.Reddie@ca.com>]
  *) Make mkdef.pl parse some of the ASN1 macros and add apropriate
     entries for variables.
Dr. Stephen Henson's avatar
 
Dr. Stephen Henson committed
     [Steve Henson]
  *) Fix a deadlock in CRYPTO_mem_leaks().
     [Bodo Moeller]

Bodo Möller's avatar
Bodo Möller committed
  *) Add functionality to apps/openssl.c for detecting locking
     problems: As the program is single-threaded, all we have
     to do is register a locking callback using an array for
     storing which locks are currently held by the program.
     [Bodo Moeller]

  *) Use a lock around the call to CRYPTO_get_ex_new_index() in
     SSL_get_ex_data_X509_STORE_idx(), which is used in
     ssl_verify_cert_chain() and thus can be called at any time
     during TLS/SSL handshakes so that thread-safety is essential.
     Unfortunately, the ex_data design is not at all suited
     for multi-threaded use, so it probably should be abolished.
     [Bodo Moeller]

  *) Added Broadcom "ubsec" ENGINE to OpenSSL.
     [Broadcom, tweaked and integrated by Geoff Thorpe]

  *) Move common extension printing code to new function
     X509V3_print_extensions(). Reorganise OCSP print routines and
     implement some needed OCSP ASN1 functions. Add OCSP extensions.
  *) New function X509_signature_print() to remove duplication in some
     print routines.
     [Steve Henson]

  *) Add a special meaning when SET OF and SEQUENCE OF flags are both
     set (this was treated exactly the same as SET OF previously). This
     is used to reorder the STACK representing the structure to match the
     encoding. This will be used to get round a problem where a PKCS7
     structure which was signed could not be verified because the STACK
     order did not reflect the encoded order.
     [Steve Henson]

  *) Reimplement the OCSP ASN1 module using the new code.
     [Steve Henson]

Dr. Stephen Henson's avatar
 
Dr. Stephen Henson committed
  *) Update the X509V3 code to permit the use of an ASN1_ITEM structure
     for its ASN1 operations. The old style function pointers still exist
     for now but they will eventually go away.
     [Steve Henson]

Dr. Stephen Henson's avatar
 
Dr. Stephen Henson committed
  *) Merge in replacement ASN1 code from the ASN1 branch. This almost
Dr. Stephen Henson's avatar
 
Dr. Stephen Henson committed
     completely replaces the old ASN1 functionality with a table driven
     encoder and decoder which interprets an ASN1_ITEM structure describing
     the ASN1 module. Compatibility with the existing ASN1 API (i2d,d2i) is
     largely maintained. Almost all of the old asn1_mac.h macro based ASN1
     has also been converted to the new form.
Dr. Stephen Henson's avatar
 
Dr. Stephen Henson committed
     [Steve Henson]

  *) Change BN_mod_exp_recp so that negative moduli are tolerated
     (the sign is ignored).  Similarly, ignore the sign in BN_MONT_CTX_set
     so that BN_mod_exp_mont and BN_mod_exp_mont_word work
     for negative moduli.
     [Bodo Moeller]

  *) Fix BN_uadd and BN_usub: Always return non-negative results instead
     of not touching the result's sign bit.
     [Bodo Moeller]

  *) BN_div bugfix: If the result is 0, the sign (res->neg) must not be
     set.
     [Bodo Moeller]

  *) Changed the LHASH code to use prototypes for callbacks, and created
     macros to declare and implement thin (optionally static) functions
     that provide type-safety and avoid function pointer casting for the
     type-specific callbacks.
     [Geoff Thorpe]

Ulf Möller's avatar
Ulf Möller committed
  *) Use better test patterns in bntest.
     [Ulf Möller]

Bodo Möller's avatar
Bodo Möller committed
  *) Added Kerberos Cipher Suites to be used with TLS, as written in
     RFC 2712.
     [Veers Staats <staatsvr@asc.hpc.mil>,
Ulf Möller's avatar
Ulf Möller committed
      Jeffrey Altman <jaltman@columbia.edu>, via Richard Levitte]
Ulf Möller's avatar
Ulf Möller committed
  *) rand_win.c fix for Borland C.
     [Ulf Möller]
 
  *) BN_rshift bugfix for n == 0.
     [Bodo Moeller]

  *) Reformat the FAQ so the different questions and answers can be divided
Ulf Möller's avatar
Ulf Möller committed
     in sections depending on the subject.
  *) Have the zlib compression code load ZLIB.DLL dynamically under
     Windows.
     [Richard Levitte]

Bodo Möller's avatar
Bodo Möller committed
  *) New function BN_mod_sqrt for computing square roots modulo a prime
     (using the probabilistic Tonelli-Shanks algorithm unless
     p == 3 (mod 4)  or  p == 5 (mod 8),  which are cases that can
     be handled deterministically).
Bodo Möller's avatar
Bodo Möller committed
     [Lenka Fibikova <fibikova@exp-math.uni-essen.de>, Bodo Moeller]

  *) Store verify_result within SSL_SESSION also for client side to
     avoid potential security hole. (Re-used sessions on the client side
     always resulted in verify_result==X509_V_OK, not using the original
     result of the server certificate verification.)
     [Lutz Jaenicke]

  *) Make BN_mod_inverse faster by explicitly handling small quotients
     in the Euclid loop. (Speed gain about 20% for small moduli [256 or
     512 bits], about 30% for larger ones [1024 or 2048 bits].)
     [Bodo Moeller]

  *) Fix ssl3_pending: If the record in s->s3->rrec is not of type
     SSL3_RT_APPLICATION_DATA, return 0.
     Similarly, change ssl2_pending to return 0 if SSL_in_init(s) is true.
     [Bodo Moeller]

  *) Fix SSL_peek:
     Both ssl2_peek and ssl3_peek, which were totally broken in earlier
     releases, have been re-implemented by renaming the previous
     implementations of ssl2_read and ssl3_read to ssl2_read_internal
     and ssl3_read_internal, respectively, and adding 'peek' parameters
     to them.  The new ssl[23]_{read,peek} functions are calls to
     ssl[23]_read_internal with the 'peek' flag set appropriately.
     A 'peek' parameter has also been added to ssl3_read_bytes, which
     does the actual work for ssl3_read_internal.
Bodo Möller's avatar
Bodo Möller committed
  *) New function BN_kronecker.
     [Bodo Moeller]

  *) Fix BN_gcd so that it works on negative inputs; the result is
     positive unless both parameters are zero.
     Previously something reasonably close to an infinite loop was
     possible because numbers could be growing instead of shrinking
     in the implementation of Euclid's algorithm.
     [Bodo Moeller]

  *) Fix BN_is_word() and BN_is_one() macros to take into account the
     sign of the number in question.

     Fix BN_is_word(a,w) to work correctly for w == 0.

     The old BN_is_word(a,w) macro is now called BN_abs_is_word(a,w)
     because its test if the absolute value of 'a' equals 'w'.
     Note that BN_abs_is_word does *not* handle w == 0 reliably;
     it exists mostly for use in the implementations of BN_is_zero(),
     BN_is_one(), and BN_is_word().
     [Bodo Moeller]

  *) Initialise "ex_data" member of RSA/DSA/DH structures prior to calling
     the method-specific "init()" handler. Also clean up ex_data after
     calling the method-specific "finish()" handler. Previously, this was
     happening the other way round.
Bodo Möller's avatar
Bodo Möller committed
  *) New function BN_swap.
     [Bodo Moeller]

  *) Use BN_nnmod instead of BN_mod in crypto/bn/bn_exp.c so that
     the exponentiation functions are more likely to produce reasonable
     results on negative inputs.
     [Bodo Moeller]

  *) Change BN_mod_mul so that the result is always non-negative.
     Previously, it could be negative if one of the factors was negative;
     I don't think anyone really wanted that behaviour.
     [Bodo Moeller]

  *) Move BN_mod_... functions into new file crypto/bn/bn_mod.c
Ulf Möller's avatar
Ulf Möller committed
     (except for exponentiation, which stays in crypto/bn/bn_exp.c,
Bodo Möller's avatar
Bodo Möller committed
     and BN_mod_mul_reciprocal, which stays in crypto/bn/bn_recp.c)
     and add new functions:
Bodo Möller's avatar
Bodo Möller committed
          BN_nnmod
          BN_mod_sqr
          BN_mod_add
Bodo Möller's avatar
Bodo Möller committed
          BN_mod_add_quick
Bodo Möller's avatar
Bodo Möller committed
          BN_mod_sub
Bodo Möller's avatar
Bodo Möller committed
          BN_mod_sub_quick
          BN_mod_lshift1
          BN_mod_lshift1_quick
          BN_mod_lshift
          BN_mod_lshift_quick

Bodo Möller's avatar
Bodo Möller committed
     These functions always generate non-negative results.
Bodo Möller's avatar
Bodo Möller committed
     BN_nnmod otherwise is like BN_mod (if BN_mod computes a remainder  r
     such that  |m| < r < 0,  BN_nnmod will output  rem + |m|  instead).
Bodo Möller's avatar
Bodo Möller committed

     BN_mod_XXX_quick(r, a, [b,] m) generates the same result as
     BN_mod_XXX(r, a, [b,] m, ctx), but requires that  a  [and  b]
     be reduced modulo  m.
Bodo Möller's avatar
Bodo Möller committed
     [Lenka Fibikova <fibikova@exp-math.uni-essen.de>, Bodo Moeller]

  *) Remove a few calls to bn_wexpand() in BN_sqr() (the one in there
     was actually never needed) and in BN_mul().  The removal in BN_mul()
     required a small change in bn_mul_part_recursive() and the addition
Ulf Möller's avatar
Ulf Möller committed
     of the functions bn_cmp_part_words(), bn_sub_part_words() and
     bn_add_part_words(), which do the same thing as bn_cmp_words(),
     bn_sub_words() and bn_add_words() except they take arrays with
     differing sizes.
     [Richard Levitte]

  *) In 'openssl passwd', verify passwords read from the terminal
     unless the '-salt' option is used (which usually means that
     verification would just waste user's time since the resulting
     hash is going to be compared with some given password hash)
     or the new '-noverify' option is used.

     This is an incompatible change, but it does not affect
     non-interactive use of 'openssl passwd' (passwords on the command
     line, '-stdin' option, '-in ...' option) and thus should not
     cause any problems.
     [Bodo Moeller]

  *) Remove all references to RSAref, since there's no more need for it.
     [Richard Levitte]

Bodo Möller's avatar
Bodo Möller committed
  *) Increase BN_CTX_NUM (the number of BIGNUMs in a BN_CTX) to 16.
     The previous value, 12, was not always sufficient for BN_mod_exp().
     [Bodo Moeller]

  *) Make DSO load along a path given through an environment variable
     (SHLIB_PATH) with shl_load().
     [Richard Levitte]

  *) Constify the ENGINE code as a result of BIGNUM constification.
     Also constify the RSA code and most things related to it.  In a
     few places, most notable in the depth of the ASN.1 code, ugly
     casts back to non-const were required (to be solved at a later
     time)
  *) Make it so the openssl application has all engines loaded by default.
     [Richard Levitte]

  *) Constify the BIGNUM routines a little more.
     [Richard Levitte]

  *) Make sure that shared libraries get the internal name engine with
     the full version number and not just 0.  This should mark the
     shared libraries as not backward compatible.  Of course, this should
     be changed again when we can guarantee backward binary compatibility.
     [Richard Levitte]

  *) Add the following functions:

	ENGINE_load_cswift()
	ENGINE_load_chil()
	ENGINE_load_atalla()
	ENGINE_load_nuron()
	ENGINE_load_builtin_engines()

     That way, an application can itself choose if external engines that
     are built-in in OpenSSL shall ever be used or not.  The benefit is
     that applications won't have to be linked with libdl or other dso
     libraries unless it's really needed.

     Changed 'openssl engine' to load all engines on demand.
     Changed the engine header files to avoid the duplication of some
     declarations (they differed!).
     [Richard Levitte]

  *) 'openssl engine' can now list capabilities.
     [Richard Levitte]

  *) Better error reporting in 'openssl engine'.
     [Richard Levitte]

  *) Never call load_dh_param(NULL) in s_server.
     [Bodo Moeller]

  *) Add engine application.  It can currently list engines by name and
     identity, and test if they are actually available.
     [Richard Levitte]

  *) Add support for shared libraries under Irix.
     [Albert Chin-A-Young <china@thewrittenword.com>]

  *) Improve RPM specification file by forcing symbolic linking and making
     sure the installed documentation is also owned by root.root.
     [Damien Miller <djm@mindrot.org>]

  *) Add configuration option to build on Linux on both big-endian and
     little-endian MIPS.
     [Ralf Baechle <ralf@uni-koblenz.de>]

Richard Levitte's avatar
Richard Levitte committed
  *) Give the OpenSSL applications more possibilities to make use of
     keys (public as well as private) handled by engines.
     [Richard Levitte]

  *) Add OCSP code that comes from CertCo.
     [Richard Levitte]

Ulf Möller's avatar
.  
Ulf Möller committed
  *) Add VMS support for the Rijndael code.
     [Richard Levitte]

  *) Added untested support for Nuron crypto accelerator.
     [Ben Laurie]

  *) Add support for external cryptographic devices.  This code was
     previously distributed separately as the "engine" branch.
     [Geoff Thorpe, Richard Levitte]

  *) Rework the filename-translation in the DSO code. It is now possible to
     have far greater control over how a "name" is turned into a filename
     depending on the operating environment and any oddities about the
     different shared library filenames on each system.
     [Geoff Thorpe]

Richard Levitte's avatar
Richard Levitte committed
  *) Support threads on FreeBSD-elf in Configure.
     [Richard Levitte]

  *) Add the possibility to create shared libraries on HP-UX