OLD | NEW |
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | 1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 /* | 2 /* |
3 * SSL3 Protocol | 3 * SSL3 Protocol |
4 * | 4 * |
5 * This Source Code Form is subject to the terms of the Mozilla Public | 5 * This Source Code Form is subject to the terms of the Mozilla Public |
6 * License, v. 2.0. If a copy of the MPL was not distributed with this | 6 * License, v. 2.0. If a copy of the MPL was not distributed with this |
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 7 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
8 | 8 |
9 /* TODO(ekr): Implement HelloVerifyRequest on server side. OK for now. */ | 9 /* TODO(ekr): Implement HelloVerifyRequest on server side. OK for now. */ |
10 | 10 |
| 11 #define _GNU_SOURCE 1 |
11 #include "cert.h" | 12 #include "cert.h" |
12 #include "ssl.h" | 13 #include "ssl.h" |
13 #include "cryptohi.h" /* for DSAU_ stuff */ | 14 #include "cryptohi.h" /* for DSAU_ stuff */ |
14 #include "keyhi.h" | 15 #include "keyhi.h" |
15 #include "secder.h" | 16 #include "secder.h" |
16 #include "secitem.h" | 17 #include "secitem.h" |
17 #include "sechash.h" | 18 #include "sechash.h" |
18 | 19 |
19 #include "sslimpl.h" | 20 #include "sslimpl.h" |
20 #include "sslproto.h" | 21 #include "sslproto.h" |
(...skipping 1856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1877 static PK11CryptFcn pk11_decrypt = NULL; | 1878 static PK11CryptFcn pk11_decrypt = NULL; |
1878 | 1879 |
1879 static PRCallOnceType resolvePK11CryptOnce; | 1880 static PRCallOnceType resolvePK11CryptOnce; |
1880 | 1881 |
1881 static PRStatus | 1882 static PRStatus |
1882 ssl3_ResolvePK11CryptFunctions(void) | 1883 ssl3_ResolvePK11CryptFunctions(void) |
1883 { | 1884 { |
1884 #ifdef LINUX | 1885 #ifdef LINUX |
1885 /* On Linux we use the system NSS libraries. Look up the PK11_Encrypt and | 1886 /* On Linux we use the system NSS libraries. Look up the PK11_Encrypt and |
1886 * PK11_Decrypt functions at run time. */ | 1887 * PK11_Decrypt functions at run time. */ |
1887 void *handle = dlopen(NULL, RTLD_LAZY); | 1888 pk11_encrypt = (PK11CryptFcn)dlsym(RTLD_DEFAULT, "PK11_Encrypt"); |
1888 if (!handle) { | 1889 pk11_decrypt = (PK11CryptFcn)dlsym(RTLD_DEFAULT, "PK11_Decrypt"); |
1889 » PORT_SetError(SEC_ERROR_LIBRARY_FAILURE); | |
1890 » return PR_FAILURE; | |
1891 } | |
1892 pk11_encrypt = (PK11CryptFcn)dlsym(handle, "PK11_Encrypt"); | |
1893 pk11_decrypt = (PK11CryptFcn)dlsym(handle, "PK11_Decrypt"); | |
1894 dlclose(handle); | |
1895 return PR_SUCCESS; | 1890 return PR_SUCCESS; |
1896 #else | 1891 #else |
1897 /* On other platforms we use our own copy of NSS. PK11_Encrypt and | 1892 /* On other platforms we use our own copy of NSS. PK11_Encrypt and |
1898 * PK11_Decrypt are known to be available. */ | 1893 * PK11_Decrypt are known to be available. */ |
1899 pk11_encrypt = PK11_Encrypt; | 1894 pk11_encrypt = PK11_Encrypt; |
1900 pk11_decrypt = PK11_Decrypt; | 1895 pk11_decrypt = PK11_Decrypt; |
1901 return PR_SUCCESS; | 1896 return PR_SUCCESS; |
1902 #endif | 1897 #endif |
1903 } | 1898 } |
1904 | 1899 |
(...skipping 10946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12851 PORT_Free(ss->ssl3.hs.recvdFragments.buf); | 12846 PORT_Free(ss->ssl3.hs.recvdFragments.buf); |
12852 } | 12847 } |
12853 } | 12848 } |
12854 | 12849 |
12855 ss->ssl3.initialized = PR_FALSE; | 12850 ss->ssl3.initialized = PR_FALSE; |
12856 | 12851 |
12857 SECITEM_FreeItem(&ss->ssl3.nextProto, PR_FALSE); | 12852 SECITEM_FreeItem(&ss->ssl3.nextProto, PR_FALSE); |
12858 } | 12853 } |
12859 | 12854 |
12860 /* End of ssl3con.c */ | 12855 /* End of ssl3con.c */ |
OLD | NEW |