~andersk/ubuntu/oneiric/openssl/spurious-reboot

« back to all changes in this revision

Viewing changes to apps/openssl.c

  • Committer: Package Import Robot
  • Author(s): Steve Beattie
  • Date: 2011-09-14 22:06:03 UTC
  • mfrom: (11.1.23 sid)
  • Revision ID: package-import@ubuntu.com-20110914220603-tsuxw8z3kt4lx9oc
Tags: 1.0.0e-2ubuntu1
* Resynchronise with Debian, fixes CVE-2011-1945, CVE-2011-3207 and
  CVE-2011-3210 (LP: #850608). Remaining changes:
  - debian/libssl1.0.0.postinst:
    + Display a system restart required notification bubble on libssl1.0.0
      upgrade.
    + Use a different priority for libssl1.0.0/restart-services depending
      on whether a desktop, or server dist-upgrade is being performed.
  - debian/{libssl1.0.0-udeb.dirs, control, rules}: Create
    libssl1.0.0-udeb, for the benefit of wget-udeb (no wget-udeb package
    in Debian).
  - debian/{libcrypto1.0.0-udeb.dirs, libssl1.0.0.dirs, libssl1.0.0.files,
    rules}: Move runtime libraries to /lib, for the benefit of
    wpasupplicant.
  - debian/patches/aesni.patch: Backport Intel AES-NI support, now from
    http://rt.openssl.org/Ticket/Display.html?id=2065 rather than the
    0.9.8 variant.
  - debian/patches/Bsymbolic-functions.patch: Link using
    -Bsymbolic-functions.
  - debian/patches/perlpath-quilt.patch: Don't change perl #! paths under
    .pc.
  - debian/rules:
    + Don't run 'make test' when cross-building.
    + Use host compiler when cross-building.  Patch from Neil Williams.
    + Don't build for processors no longer supported: i486, i586 (on
      i386), v8 (on sparc).
    + Fix Makefile to properly clean up libs/ dirs in clean target.
    + Replace duplicate files in the doc directory with symlinks.
* debian/libssl1.0.0.postinst: only display restart notification on
  servers (LP: #244250)

Show diffs side-by-side

added added

removed removed

Lines of Context:
212
212
                }
213
213
        }
214
214
 
 
215
#if defined( OPENSSL_SYS_VMS) && (__INITIAL_POINTER_SIZE == 64)
 
216
# define ARGV _Argv
 
217
#else
 
218
# define ARGV Argv
 
219
#endif
215
220
 
216
 
int main(int Argc, char *Argv[])
 
221
int main(int Argc, char *ARGV[])
217
222
        {
218
223
        ARGS arg;
219
224
#define PROG_NAME_SIZE  39
227
232
        char **argv,*p;
228
233
        LHASH_OF(FUNCTION) *prog=NULL;
229
234
        long errline;
230
 
 
 
235
 
 
236
#if defined( OPENSSL_SYS_VMS) && (__INITIAL_POINTER_SIZE == 64)
 
237
        /* 2011-03-22 SMS.
 
238
         * If we have 32-bit pointers everywhere, then we're safe, and
 
239
         * we bypass this mess, as on non-VMS systems.  (See ARGV,
 
240
         * above.)
 
241
         * Problem 1: Compaq/HP C before V7.3 always used 32-bit
 
242
         * pointers for argv[].
 
243
         * Fix 1: For a 32-bit argv[], when we're using 64-bit pointers
 
244
         * everywhere else, we always allocate and use a 64-bit
 
245
         * duplicate of argv[].
 
246
         * Problem 2: Compaq/HP C V7.3 (Alpha, IA64) before ECO1 failed
 
247
         * to NULL-terminate a 64-bit argv[].  (As this was written, the
 
248
         * compiler ECO was available only on IA64.)
 
249
         * Fix 2: Unless advised not to (VMS_TRUST_ARGV), we test a
 
250
         * 64-bit argv[argc] for NULL, and, if necessary, use a
 
251
         * (properly) NULL-terminated (64-bit) duplicate of argv[].
 
252
         * The same code is used in either case to duplicate argv[].
 
253
         * Some of these decisions could be handled in preprocessing,
 
254
         * but the code tends to get even uglier, and the penalty for
 
255
         * deciding at compile- or run-time is tiny.
 
256
         */
 
257
        char **Argv = NULL;
 
258
        int free_Argv = 0;
 
259
 
 
260
        if ((sizeof( _Argv) < 8)        /* 32-bit argv[]. */
 
261
# if !defined( VMS_TRUST_ARGV)
 
262
         || (_Argv[ Argc] != NULL)      /* Untrusted argv[argc] not NULL. */
 
263
# endif
 
264
                )
 
265
                {
 
266
                int i;
 
267
                Argv = OPENSSL_malloc( (Argc+ 1)* sizeof( char *));
 
268
                if (Argv == NULL)
 
269
                        { ret = -1; goto end; }
 
270
                for(i = 0; i < Argc; i++)
 
271
                        Argv[i] = _Argv[i];
 
272
                Argv[ Argc] = NULL;     /* Certain NULL termination. */
 
273
                free_Argv = 1;
 
274
                }
 
275
        else
 
276
                {
 
277
                /* Use the known-good 32-bit argv[] (which needs the
 
278
                 * type cast to satisfy the compiler), or the trusted or
 
279
                 * tested-good 64-bit argv[] as-is. */
 
280
                Argv = (char **)_Argv;
 
281
                }
 
282
#endif /* defined( OPENSSL_SYS_VMS) && (__INITIAL_POINTER_SIZE == 64) */
 
283
 
231
284
        arg.data=NULL;
232
285
        arg.count=0;
233
286
 
373
426
                BIO_free(bio_err);
374
427
                bio_err=NULL;
375
428
                }
 
429
#if defined( OPENSSL_SYS_VMS) && (__INITIAL_POINTER_SIZE == 64)
 
430
        /* Free any duplicate Argv[] storage. */
 
431
        if (free_Argv)
 
432
                {
 
433
                OPENSSL_free(Argv);
 
434
                }
 
435
#endif
376
436
        OPENSSL_EXIT(ret);
377
437
        }
378
438