Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
8f4eab23
Kaydet (Commit)
8f4eab23
authored
Mar 18, 2001
tarafından
Moshe Zadka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Committing patch 405101
üst
261d91a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
socketmodule.c
Modules/socketmodule.c
+27
-0
No files found.
Modules/socketmodule.c
Dosyayı görüntüle @
8f4eab23
...
...
@@ -194,6 +194,7 @@ Socket methods:
#include "openssl/pem.h"
#include "openssl/ssl.h"
#include "openssl/err.h"
#include "openssl/rand.h"
#endif
/* USE_SSL */
#if defined(MS_WINDOWS) || defined(__BEOS__)
...
...
@@ -2544,6 +2545,32 @@ init_socket(void)
if
(
PyDict_SetItemString
(
d
,
"SSLType"
,
(
PyObject
*
)
&
SSL_Type
)
!=
0
)
return
;
if
(
RAND_status
()
==
0
)
{
#ifdef USE_EGD
char
random_device
[
MAXPATHLEN
+
1
];
if
(
!
RAND_file_name
(
random_device
,
MAXPATHLEN
+
1
))
{
PyErr_SetObject
(
SSLErrorObject
,
PyString_FromString
(
"RAND_file_name error"
));
return
;
}
if
(
RAND_egd
(
random_device
)
==
-
1
)
{
PyErr_SetObject
(
SSLErrorObject
,
PyString_FromString
(
"RAND_egd error"
));
return
;
}
#else
/* USE_EGD not defined */
char
random_string
[
32
];
int
i
;
PyErr_Warn
(
PyExc_RuntimeWarning
,
"using insecure method to generate random numbers"
);
srand
(
time
(
NULL
));
for
(
i
=
0
;
i
<
sizeof
(
random_string
);
i
++
)
{
random_string
[
i
]
=
rand
();
}
RAND_seed
(
random_string
,
sizeof
(
random_string
));
#endif
/* USE_EGD */
}
#endif
/* USE_SSL */
PyDict_SetItemString
(
d
,
"error"
,
PySocket_Error
);
PySocketSock_Type
.
ob_type
=
&
PyType_Type
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment