diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/cryptlib.c | 46 |
1 files changed, 21 insertions, 25 deletions
diff --git a/src/lib/libcrypto/cryptlib.c b/src/lib/libcrypto/cryptlib.c index dc3cc2ab02..ca583d59a9 100644 --- a/src/lib/libcrypto/cryptlib.c +++ b/src/lib/libcrypto/cryptlib.c | |||
| @@ -117,10 +117,6 @@ | |||
| 117 | #include "cryptlib.h" | 117 | #include "cryptlib.h" |
| 118 | #include <openssl/safestack.h> | 118 | #include <openssl/safestack.h> |
| 119 | 119 | ||
| 120 | #if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN16) | ||
| 121 | static double SSLeay_MSVC5_hack = 0.0; /* and for VC1.5 */ | ||
| 122 | #endif | ||
| 123 | |||
| 124 | DECLARE_STACK_OF(CRYPTO_dynlock) | 120 | DECLARE_STACK_OF(CRYPTO_dynlock) |
| 125 | 121 | ||
| 126 | /* real #defines in crypto.h, keep these upto date */ | 122 | /* real #defines in crypto.h, keep these upto date */ |
| @@ -316,8 +312,8 @@ CRYPTO_destroy_dynlockid(int i) | |||
| 316 | } | 312 | } |
| 317 | } | 313 | } |
| 318 | 314 | ||
| 319 | struct CRYPTO_dynlock_value | 315 | struct CRYPTO_dynlock_value * |
| 320 | *CRYPTO_get_dynlock_value(int i) | 316 | CRYPTO_get_dynlock_value(int i) |
| 321 | { | 317 | { |
| 322 | CRYPTO_dynlock *pointer = NULL; | 318 | CRYPTO_dynlock *pointer = NULL; |
| 323 | if (i) | 319 | if (i) |
| @@ -337,7 +333,8 @@ struct CRYPTO_dynlock_value | |||
| 337 | return NULL; | 333 | return NULL; |
| 338 | } | 334 | } |
| 339 | 335 | ||
| 340 | struct CRYPTO_dynlock_value *(*CRYPTO_get_dynlock_create_callback(void))( | 336 | struct CRYPTO_dynlock_value * |
| 337 | (*CRYPTO_get_dynlock_create_callback(void))( | ||
| 341 | const char *file, int line) | 338 | const char *file, int line) |
| 342 | { | 339 | { |
| 343 | return (dynlock_create_callback); | 340 | return (dynlock_create_callback); |
| @@ -445,7 +442,7 @@ CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr) | |||
| 445 | const unsigned char *src = (void *)&id->ptr; | 442 | const unsigned char *src = (void *)&id->ptr; |
| 446 | unsigned char snum = sizeof(id->ptr); | 443 | unsigned char snum = sizeof(id->ptr); |
| 447 | while (snum--) | 444 | while (snum--) |
| 448 | accum += *(src++) * hash_coeffs[(snum + dnum) & 7]; | 445 | accum += *(src++) * hash_coeffs[(snum + dnum) & 7]; |
| 449 | accum += dnum; | 446 | accum += dnum; |
| 450 | *(dest++) = accum & 255; | 447 | *(dest++) = accum & 255; |
| 451 | } | 448 | } |
| @@ -613,8 +610,8 @@ CRYPTO_add_lock(int *pointer, int amount, int type, const char *file, | |||
| 613 | return (ret); | 610 | return (ret); |
| 614 | } | 611 | } |
| 615 | 612 | ||
| 616 | const char | 613 | const char * |
| 617 | *CRYPTO_get_lock_name(int type) | 614 | CRYPTO_get_lock_name(int type) |
| 618 | { | 615 | { |
| 619 | if (type < 0) | 616 | if (type < 0) |
| 620 | return("dynamic"); | 617 | return("dynamic"); |
| @@ -631,8 +628,8 @@ const char | |||
| 631 | defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64) | 628 | defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64) |
| 632 | 629 | ||
| 633 | unsigned int OPENSSL_ia32cap_P[2]; | 630 | unsigned int OPENSSL_ia32cap_P[2]; |
| 634 | unsigned long | 631 | unsigned long * |
| 635 | *OPENSSL_ia32cap_loc(void) | 632 | OPENSSL_ia32cap_loc(void) |
| 636 | { | 633 | { |
| 637 | if (sizeof(long) == 4) | 634 | if (sizeof(long) == 4) |
| 638 | /* | 635 | /* |
| @@ -646,11 +643,7 @@ unsigned long | |||
| 646 | 643 | ||
| 647 | #if defined(OPENSSL_CPUID_OBJ) && !defined(OPENSSL_NO_ASM) && !defined(I386_ONLY) | 644 | #if defined(OPENSSL_CPUID_OBJ) && !defined(OPENSSL_NO_ASM) && !defined(I386_ONLY) |
| 648 | #define OPENSSL_CPUID_SETUP | 645 | #define OPENSSL_CPUID_SETUP |
| 649 | #if defined(_WIN32) | ||
| 650 | typedef unsigned __int64 IA32CAP; | ||
| 651 | #else | ||
| 652 | typedef unsigned long long IA32CAP; | 646 | typedef unsigned long long IA32CAP; |
| 653 | #endif | ||
| 654 | void | 647 | void |
| 655 | OPENSSL_cpuid_setup(void) | 648 | OPENSSL_cpuid_setup(void) |
| 656 | { | 649 | { |
| @@ -665,11 +658,8 @@ OPENSSL_cpuid_setup(void) | |||
| 665 | trigger = 1; | 658 | trigger = 1; |
| 666 | if ((env = getenv("OPENSSL_ia32cap"))) { | 659 | if ((env = getenv("OPENSSL_ia32cap"))) { |
| 667 | int off = (env[0]=='~') ? 1 : 0; | 660 | int off = (env[0]=='~') ? 1 : 0; |
| 668 | #if defined(_WIN32) | 661 | if (!sscanf(env+off, "%lli",(long long *)&vec)) |
| 669 | if (!sscanf(env+off, "%I64i", &vec)) vec = strtoul(env+off, NULL, 0); | 662 | vec = strtoul(env+off, NULL, 0); |
| 670 | #else | ||
| 671 | if (!sscanf(env+off, "%lli",(long long *)&vec)) vec = strtoul(env+off, NULL, 0); | ||
| 672 | #endif | ||
| 673 | if (off) | 663 | if (off) |
| 674 | vec = OPENSSL_ia32_cpuid()&~vec; | 664 | vec = OPENSSL_ia32_cpuid()&~vec; |
| 675 | } else | 665 | } else |
| @@ -690,13 +680,17 @@ OPENSSL_cpuid_setup(void) | |||
| 690 | } | 680 | } |
| 691 | #endif | 681 | #endif |
| 692 | int OPENSSL_NONPIC_relocated = 0; | 682 | int OPENSSL_NONPIC_relocated = 0; |
| 683 | |||
| 693 | #if !defined(OPENSSL_CPUID_SETUP) && !defined(OPENSSL_CPUID_OBJ) | 684 | #if !defined(OPENSSL_CPUID_SETUP) && !defined(OPENSSL_CPUID_OBJ) |
| 694 | void | 685 | void |
| 695 | OPENSSL_cpuid_setup(void) {} | 686 | OPENSSL_cpuid_setup(void) |
| 687 | { | ||
| 688 | } | ||
| 696 | #endif | 689 | #endif |
| 697 | 690 | ||
| 698 | 691 | ||
| 699 | void OPENSSL_showfatal(const char *fmta, ...) | 692 | void |
| 693 | OPENSSL_showfatal(const char *fmta, ...) | ||
| 700 | { | 694 | { |
| 701 | va_list ap; | 695 | va_list ap; |
| 702 | 696 | ||
| @@ -705,7 +699,8 @@ void OPENSSL_showfatal(const char *fmta, ...) | |||
| 705 | va_end (ap); | 699 | va_end (ap); |
| 706 | } | 700 | } |
| 707 | 701 | ||
| 708 | int OPENSSL_isservice(void) | 702 | int |
| 703 | OPENSSL_isservice(void) | ||
| 709 | { | 704 | { |
| 710 | return 0; | 705 | return 0; |
| 711 | } | 706 | } |
| @@ -719,7 +714,8 @@ OpenSSLDie(const char *file, int line, const char *assertion) | |||
| 719 | abort(); | 714 | abort(); |
| 720 | } | 715 | } |
| 721 | 716 | ||
| 722 | void *OPENSSL_stderr(void) | 717 | void * |
| 718 | OPENSSL_stderr(void) | ||
| 723 | { | 719 | { |
| 724 | return stderr; | 720 | return stderr; |
| 725 | } | 721 | } |
