OLD | NEW |
1 /* ==================================================================== | 1 /* ==================================================================== |
2 * Copyright (c) 1999 The OpenSSL Project. All rights reserved. | 2 * Copyright (c) 1999 The OpenSSL Project. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * | 10 * |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 * (eay@cryptsoft.com). This product includes software written by Tim | 50 * (eay@cryptsoft.com). This product includes software written by Tim |
51 * Hudson (tjh@cryptsoft.com). | 51 * Hudson (tjh@cryptsoft.com). |
52 * | 52 * |
53 */ | 53 */ |
54 | 54 |
55 #include <stdio.h> | 55 #include <stdio.h> |
56 #include <openssl/bn.h> | 56 #include <openssl/bn.h> |
57 #include <string.h> | 57 #include <string.h> |
58 | 58 |
59 #include <openssl/e_os2.h> | 59 #include <openssl/e_os2.h> |
60 #if !defined(OPENSSL_SYS_MSDOS) || defined(__DJGPP__) | 60 #if !defined(OPENSSL_SYS_MSDOS) || defined(__DJGPP__) || defined(__MINGW32__) |
61 #include <sys/types.h> | 61 #include <sys/types.h> |
62 #include <unistd.h> | 62 #include <unistd.h> |
63 #else | 63 #else |
64 #include <process.h> | 64 #include <process.h> |
65 typedef int pid_t; | 65 typedef int pid_t; |
66 #endif | 66 #endif |
67 | 67 |
68 #if defined(OPENSSL_SYS_NETWARE) && defined(NETWARE_CLIB) | 68 #if defined(OPENSSL_SYS_NETWARE) && defined(NETWARE_CLIB) |
69 #define getpid GetThreadID | 69 #define getpid GetThreadID |
70 extern int GetThreadID(void); | 70 extern int GetThreadID(void); |
| 71 #elif defined(_WIN32) && !defined(__WATCOMC__) |
| 72 #define getpid _getpid |
71 #endif | 73 #endif |
72 | 74 |
73 #include <openssl/crypto.h> | 75 #include <openssl/crypto.h> |
74 #include <openssl/dso.h> | 76 #include <openssl/dso.h> |
75 #include <openssl/engine.h> | 77 #include <openssl/engine.h> |
76 #include <openssl/buffer.h> | 78 #include <openssl/buffer.h> |
77 #ifndef OPENSSL_NO_RSA | 79 #ifndef OPENSSL_NO_RSA |
78 #include <openssl/rsa.h> | 80 #include <openssl/rsa.h> |
79 #endif | 81 #endif |
80 #ifndef OPENSSL_NO_DSA | 82 #ifndef OPENSSL_NO_DSA |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 static AEP_RV aep_get_connection(AEP_CONNECTION_HNDL_PTR phConnection) | 862 static AEP_RV aep_get_connection(AEP_CONNECTION_HNDL_PTR phConnection) |
861 { | 863 { |
862 int count; | 864 int count; |
863 AEP_RV rv = AEP_R_OK; | 865 AEP_RV rv = AEP_R_OK; |
864 | 866 |
865 /*Get the current process id*/ | 867 /*Get the current process id*/ |
866 pid_t curr_pid; | 868 pid_t curr_pid; |
867 | 869 |
868 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE); | 870 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE); |
869 | 871 |
870 #ifdef NETWARE_CLIB | |
871 curr_pid = GetThreadID(); | |
872 #elif defined(_WIN32) | |
873 curr_pid = _getpid(); | |
874 #else | |
875 curr_pid = getpid(); | 872 curr_pid = getpid(); |
876 #endif | |
877 | 873 |
878 /*Check if this is the first time this is being called from the current | 874 /*Check if this is the first time this is being called from the current |
879 process*/ | 875 process*/ |
880 if (recorded_pid != curr_pid) | 876 if (recorded_pid != curr_pid) |
881 { | 877 { |
882 /*Remember our pid so we can check if we're in a new process*/ | 878 /*Remember our pid so we can check if we're in a new process*/ |
883 recorded_pid = curr_pid; | 879 recorded_pid = curr_pid; |
884 | 880 |
885 /*Call Finalize to make sure we have not inherited some data | 881 /*Call Finalize to make sure we have not inherited some data |
886 from a parent process*/ | 882 from a parent process*/ |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1135 ((unsigned) AEP_BigNum[1] << 8 | AEP_BigNum[0]); | 1131 ((unsigned) AEP_BigNum[1] << 8 | AEP_BigNum[0]); |
1136 AEP_BigNum += 4; | 1132 AEP_BigNum += 4; |
1137 } | 1133 } |
1138 #endif | 1134 #endif |
1139 | 1135 |
1140 return AEP_R_OK; | 1136 return AEP_R_OK; |
1141 } | 1137 } |
1142 | 1138 |
1143 #endif /* !OPENSSL_NO_HW_AEP */ | 1139 #endif /* !OPENSSL_NO_HW_AEP */ |
1144 #endif /* !OPENSSL_NO_HW */ | 1140 #endif /* !OPENSSL_NO_HW */ |
OLD | NEW |