~ubuntu-branches/ubuntu/gutsy/php5/gutsy

« back to all changes in this revision

Viewing changes to ext/openssl/openssl.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt, CVE-2007-0905, CVE-2007-0906, CVE-2007-0909, CVE-2007-0910
  • Date: 2007-02-20 17:54:46 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20070220175446-nudqyuv0dfowel3r
Tags: 5.2.1-0ubuntu1
* New upstream security/bugfix release:
  - safe_mode & open_basedir bypasses inside the session extension
    [CVE-2007-0905]
  - multiple buffer overflows in various extensions and functions
    [CVE-2007-0906]
  - underflow in the internal sapi_header_op() function [CVE-2007-0907]
  - information disclosure in the wddx extension [CVE-2007-0908]
  - string format vulnerability in *print() functions on 64 bit systems
    [CVE-2007-0909]
  - possible clobbering of super-globals in several code paths
    [CVE-2007-0910]
* Adapted patches to new upstream release:
  - 006-debian_quirks.patch
  - 034-apache2_umask_fix.patch
  - 044-strtod_arm_fix.patch
* Drop 109-libdb4.4.patch: Obsolete, upstream now checks for db 4.5 and 4.4.
* Drop 114-zend_alloc.c_m68k_alignment.patch and
  115-zend_alloc.c_memleak.patch: Applied upstream.
* Add debian/patches/000upstream-str_ireplace_offbyone.patch:
  - Fix off-by-one in str_ireplace(), a regression introduced in 5.2.1.
  - Patch taken from upstream CVS:
    http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.630&r2=1.631
  - CVE-2007-0911
* debian/control: Set Ubuntu maintainer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
   +----------------------------------------------------------------------+
3
3
   | PHP Version 5                                                        |
4
4
   +----------------------------------------------------------------------+
5
 
   | Copyright (c) 1997-2006 The PHP Group                                |
 
5
   | Copyright (c) 1997-2007 The PHP Group                                |
6
6
   +----------------------------------------------------------------------+
7
7
   | This source file is subject to version 3.01 of the PHP license,      |
8
8
   | that is bundled with this package in the file LICENSE, and is        |
18
18
   +----------------------------------------------------------------------+
19
19
 */
20
20
 
21
 
/* $Id: openssl.c,v 1.98.2.5.2.23 2006/10/15 21:09:24 tony2001 Exp $ */
 
21
/* $Id: openssl.c,v 1.98.2.5.2.27 2007/01/20 22:08:29 rrichards Exp $ */
22
22
 
23
23
#ifdef HAVE_CONFIG_H
24
24
#include "config.h"
1003
1003
        
1004
1004
        add_assoc_name_entry(return_value, "issuer",            X509_get_issuer_name(cert), useshortnames TSRMLS_CC);
1005
1005
        add_assoc_long(return_value, "version",                         X509_get_version(cert));
1006
 
        add_assoc_long(return_value, "serialNumber",            ASN1_INTEGER_get(X509_get_serialNumber(cert)));
 
1006
 
 
1007
        add_assoc_string(return_value, "serialNumber", i2s_ASN1_INTEGER(NULL, X509_get_serialNumber(cert)), 1); 
1007
1008
 
1008
1009
        add_assoc_asn1_string(return_value, "validFrom",        X509_get_notBefore(cert));
1009
1010
        add_assoc_asn1_string(return_value, "validTo",          X509_get_notAfter(cert));
1957
1958
                                /* got the key - return it */
1958
1959
                                return (EVP_PKEY*)what;
1959
1960
                        }
 
1961
                } else {
 
1962
                        /* other types could be used here - eg: file pointers and read in the data from them */
 
1963
                        TMP_CLEAN;
1960
1964
                }
1961
 
 
1962
 
                /* other types could be used here - eg: file pointers and read in the data from them */
1963
 
                TMP_CLEAN;
1964
1965
        } else {
1965
1966
                /* force it to be a string and check if it refers to a file */
1966
1967
                /* passing non string values leaks, object uses toString, it returns NULL 
2055
2056
                                        return_val = req->priv_key;
2056
2057
                                }
2057
2058
                                break;
2058
 
#ifndef NO_DSA
 
2059
#if !defined(NO_DSA) && defined(HAVE_DSA_DEFAULT_METHOD)
2059
2060
                        case OPENSSL_KEYTYPE_DSA:
2060
2061
                                {
2061
2062
                                        DSA *dsapar = DSA_generate_parameters(req->priv_key_bits, NULL, 0, NULL, NULL, NULL, NULL);