Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eta
gajim
Commits
ec2156ec
Commit
ec2156ec
authored
11 years ago
by
fedor.brunner
Browse files
Options
Downloads
Patches
Plain Diff
Update entropy gathering for interface changes of pyOpenSSL.
Fixes: #7642
parent
460c6286
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/common/crypto.py
+2
-2
2 additions, 2 deletions
src/common/crypto.py
src/common/jingle_xtls.py
+2
-2
2 additions, 2 deletions
src/common/jingle_xtls.py
src/gajim.py
+2
-2
2 additions, 2 deletions
src/gajim.py
with
6 additions
and
6 deletions
src/common/crypto.py
+
2
−
2
View file @
ec2156ec
...
...
@@ -87,7 +87,7 @@ def add_entropy_sources_OpenSSL():
os
.
environ
,
os
.
getcwd
(),
os
.
getpid
()]
for
s
in
sources
:
OpenSSL
.
rand
.
add
(
str
(
s
).
encode
(
'
utf-8
'
),
0.0
1
)
OpenSSL
.
rand
.
add
(
str
(
s
).
encode
(
'
utf-8
'
),
1
)
# On Windows add the current contents of the screen to the PRNG state.
if
os
.
name
==
'
nt
'
:
...
...
@@ -105,7 +105,7 @@ def add_entropy_sources_OpenSSL():
# Limit the ammount of read bytes, in case a memory
# file was opened
OpenSSL
.
rand
.
add
(
str
(
fp
.
read
(
5000
)).
encode
(
'
utf-8
'
),
0.0
1
)
1
)
except
:
# Ignore all read and access errors
pass
...
...
This diff is collapsed.
Click to expand it.
src/common/jingle_xtls.py
+
2
−
2
View file @
ec2156ec
...
...
@@ -118,7 +118,7 @@ def get_context(fingerprint, verify_cb=None, remote_jid=None):
dh_params_name
=
os
.
path
.
join
(
gajim
.
MY_CERT_DIR
,
DH_PARAMS
)
try
:
with
open
(
dh_params_name
,
"
r
"
)
as
dh_params_file
:
ctx
.
load_tmp_dh
(
dh_params_name
)
ctx
.
load_tmp_dh
(
str
(
dh_params_name
)
.
encode
(
'
utf-8
'
))
except
IOError
as
err
:
log
.
warn
(
'
Unable to load DH parameter file: %s. You should generate it
'
'
by using this command :
"
openssl dhparam 4096 -out
'
...
...
@@ -128,7 +128,7 @@ def get_context(fingerprint, verify_cb=None, remote_jid=None):
'
other
'
,
DEFAULT_DH_PARAMS
)
try
:
with
open
(
default_dh_params_name
,
"
r
"
)
as
default_dh_params_file
:
ctx
.
load_tmp_dh
(
default_dh_params_name
)
ctx
.
load_tmp_dh
(
str
(
default_dh_params_name
)
.
encode
(
'
utf-8
'
))
except
IOError
as
err
:
log
.
error
(
'
Unable to load default DH parameter file: %s , %s
'
%
(
default_dh_params_name
,
err
))
...
...
This diff is collapsed.
Click to expand it.
src/gajim.py
+
2
−
2
View file @
ec2156ec
...
...
@@ -320,7 +320,7 @@ try:
from
common
import
crypto
PYOPENSSL_PRNG_PRESENT
=
True
# Seed from file
OpenSSL
.
rand
.
load_file
(
RNG_SEED
)
OpenSSL
.
rand
.
load_file
(
str
(
RNG_SEED
)
.
encode
(
'
utf-8
'
))
crypto
.
add_entropy_sources_OpenSSL
()
except
ImportError
:
log
.
info
(
"
PyOpenSSL PRNG not available
"
)
...
...
@@ -473,7 +473,7 @@ del pid_dir
def
on_exit
():
# Save the entropy from OpenSSL PRNG
if
PYOPENSSL_PRNG_PRESENT
:
OpenSSL
.
rand
.
write_file
(
RNG_SEED
)
OpenSSL
.
rand
.
write_file
(
str
(
RNG_SEED
)
.
encode
(
'
utf-8
'
))
# delete pid file on normal exit
if
os
.
path
.
exists
(
pid_filename
):
os
.
remove
(
pid_filename
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment