python-bareos 25.0.2__py3-none-any.whl → 25.0.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bareos/VERSION.txt +1 -1
- bareos/bsock/__init__.py +15 -2
- bareos/bsock/lowlevel.py +36 -20
- {python_bareos-25.0.2.dist-info → python_bareos-25.0.4.dist-info}/METADATA +15 -2
- {python_bareos-25.0.2.dist-info → python_bareos-25.0.4.dist-info}/RECORD +11 -11
- {python_bareos-25.0.2.dist-info → python_bareos-25.0.4.dist-info}/WHEEL +1 -1
- {python_bareos-25.0.2.data → python_bareos-25.0.4.data}/scripts/bareos-fd-connect.py +0 -0
- {python_bareos-25.0.2.data → python_bareos-25.0.4.data}/scripts/bconsole-json.py +0 -0
- {python_bareos-25.0.2.data → python_bareos-25.0.4.data}/scripts/bconsole.py +0 -0
- {python_bareos-25.0.2.dist-info → python_bareos-25.0.4.dist-info}/licenses/LICENSE.txt +0 -0
- {python_bareos-25.0.2.dist-info → python_bareos-25.0.4.dist-info}/top_level.txt +0 -0
bareos/VERSION.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
25.0.
|
|
1
|
+
25.0.4
|
bareos/bsock/__init__.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# BAREOS - Backup Archiving REcovery Open Sourced
|
|
2
2
|
#
|
|
3
|
-
# Copyright (C) 2016-
|
|
3
|
+
# Copyright (C) 2016-2026 Bareos GmbH & Co. KG
|
|
4
4
|
#
|
|
5
5
|
# This program is Free Software; you can redistribute it and/or
|
|
6
6
|
# modify it under the terms of version three of the GNU Affero General Public
|
|
@@ -146,7 +146,11 @@ Since Bareos >= 18.2.4, Bareos supports TLS-PSK (Transport-Layer-Security Pre-Sh
|
|
|
146
146
|
|
|
147
147
|
Unfortunately the Python core module ``ssl`` does support TLS-PSK only with Python >= 3.13.
|
|
148
148
|
For some older versions of Python,
|
|
149
|
-
the extra
|
|
149
|
+
the extra modules
|
|
150
|
+
``sslpsk3`` (Python >= 3.7, see https://github.com/kuba2k2/sslpsk3)
|
|
151
|
+
or
|
|
152
|
+
``sslpsk`` (Python <= 3.9, see https://github.com/drbild/sslpsk)
|
|
153
|
+
offers limited support.
|
|
150
154
|
|
|
151
155
|
Fallback To Unencrypted Connections
|
|
152
156
|
-----------------------------------
|
|
@@ -182,6 +186,15 @@ To enforce a encrypted connection, use the ``tls_psk_require=True`` parameter:
|
|
|
182
186
|
|
|
183
187
|
In this case, an exception is raised, if the connection can not be established via TLS-PSK.
|
|
184
188
|
|
|
189
|
+
sslpsk3
|
|
190
|
+
-------
|
|
191
|
+
|
|
192
|
+
The extra module `sslpsk3` (see https://github.com/kuba2k2/sslpsk3)
|
|
193
|
+
is an extended fork of `sslpsk`
|
|
194
|
+
and extends the core module `ssl` by TLS-PSK.
|
|
195
|
+
|
|
196
|
+
It is installable via **pip**, see https://pypi.org/project/sslpsk3.
|
|
197
|
+
|
|
185
198
|
sslpsk
|
|
186
199
|
------
|
|
187
200
|
|
bareos/bsock/lowlevel.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# BAREOS - Backup Archiving REcovery Open Sourced
|
|
2
2
|
#
|
|
3
|
-
# Copyright (C) 2015-
|
|
3
|
+
# Copyright (C) 2015-2026 Bareos GmbH & Co. KG
|
|
4
4
|
#
|
|
5
5
|
# This program is Free Software; you can redistribute it and/or
|
|
6
6
|
# modify it under the terms of version three of the GNU Affero General Public
|
|
@@ -60,12 +60,15 @@ if not getattr(ssl, "HAS_PSK", False):
|
|
|
60
60
|
|
|
61
61
|
warnings.formatwarning = format_warning_short
|
|
62
62
|
try:
|
|
63
|
-
import
|
|
63
|
+
import sslpsk3
|
|
64
64
|
except ImportError:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
try:
|
|
66
|
+
import sslpsk
|
|
67
|
+
except ImportError:
|
|
68
|
+
warnings.warn(
|
|
69
|
+
"Connection encryption via TLS-PSK is not available "
|
|
70
|
+
"(not available in 'ssl' and neither extra module 'sslpsk3' nor 'sslpsk' is installed)."
|
|
71
|
+
)
|
|
69
72
|
|
|
70
73
|
|
|
71
74
|
class LowLevel(object):
|
|
@@ -285,19 +288,28 @@ class LowLevel(object):
|
|
|
285
288
|
context.set_psk_client_callback(lambda hint: (identity, password))
|
|
286
289
|
self.socket = context.wrap_socket(client_socket, server_side=False)
|
|
287
290
|
else:
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
)
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
291
|
+
if "sslpsk3" in sys.modules:
|
|
292
|
+
context = sslpsk3.SSLPSKContext(ssl.PROTOCOL_TLS_CLIENT)
|
|
293
|
+
# TLS1.3 only works using Python >= 3.13
|
|
294
|
+
context.maximum_version = ssl.TLSVersion.TLSv1_2
|
|
295
|
+
context.check_hostname = False
|
|
296
|
+
context.set_ciphers(ciphers)
|
|
297
|
+
context.set_psk_client_callback(lambda hint: (identity, password))
|
|
298
|
+
self.socket = context.wrap_socket(client_socket, server_side=False)
|
|
299
|
+
else:
|
|
300
|
+
try:
|
|
301
|
+
self.socket = sslpsk.wrap_socket(
|
|
302
|
+
client_socket,
|
|
303
|
+
ssl_version=self.tls_version,
|
|
304
|
+
ciphers=ciphers,
|
|
305
|
+
psk=(password, identity),
|
|
306
|
+
server_side=False,
|
|
307
|
+
)
|
|
308
|
+
except ssl.SSLError as e:
|
|
309
|
+
# raise ConnectionError(
|
|
310
|
+
# "failed to connect to host {0}, port {1}: {2}".format(self.address, self.port, str(e)))
|
|
311
|
+
# Using a general raise to keep more information about the type of error.
|
|
312
|
+
raise
|
|
301
313
|
return True
|
|
302
314
|
|
|
303
315
|
def get_tls_psk_identity(self):
|
|
@@ -313,7 +325,11 @@ class LowLevel(object):
|
|
|
313
325
|
@staticmethod
|
|
314
326
|
def is_tls_psk_available():
|
|
315
327
|
"""Checks if TLS-PSK is available."""
|
|
316
|
-
return
|
|
328
|
+
return (
|
|
329
|
+
getattr(ssl, "HAS_PSK", False)
|
|
330
|
+
or ("sslpsk3" in sys.modules)
|
|
331
|
+
or ("sslpsk" in sys.modules)
|
|
332
|
+
)
|
|
317
333
|
|
|
318
334
|
def get_protocol_version(self):
|
|
319
335
|
"""Get the Bareos Console protocol version that is used.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-bareos
|
|
3
|
-
Version: 25.0.
|
|
3
|
+
Version: 25.0.4
|
|
4
4
|
Summary: Client library and tools for Bareos console access.
|
|
5
5
|
Home-page: https://github.com/bareos/bareos/
|
|
6
6
|
Author: Bareos Team
|
|
@@ -167,7 +167,11 @@ Since Bareos >= 18.2.4, Bareos supports TLS-PSK (Transport-Layer-Security Pre-Sh
|
|
|
167
167
|
|
|
168
168
|
Unfortunately the Python core module ``ssl`` does support TLS-PSK only with Python >= 3.13.
|
|
169
169
|
For some older versions of Python,
|
|
170
|
-
the extra
|
|
170
|
+
the extra modules
|
|
171
|
+
``sslpsk3`` (Python >= 3.7, see https://github.com/kuba2k2/sslpsk3)
|
|
172
|
+
or
|
|
173
|
+
``sslpsk`` (Python <= 3.9, see https://github.com/drbild/sslpsk)
|
|
174
|
+
offers limited support.
|
|
171
175
|
|
|
172
176
|
Fallback To Unencrypted Connections
|
|
173
177
|
-----------------------------------
|
|
@@ -203,6 +207,15 @@ To enforce a encrypted connection, use the ``tls_psk_require=True`` parameter:
|
|
|
203
207
|
|
|
204
208
|
In this case, an exception is raised, if the connection can not be established via TLS-PSK.
|
|
205
209
|
|
|
210
|
+
sslpsk3
|
|
211
|
+
-------
|
|
212
|
+
|
|
213
|
+
The extra module `sslpsk3` (see https://github.com/kuba2k2/sslpsk3)
|
|
214
|
+
is an extended fork of `sslpsk`
|
|
215
|
+
and extends the core module `ssl` by TLS-PSK.
|
|
216
|
+
|
|
217
|
+
It is installable via **pip**, see https://pypi.org/project/sslpsk3.
|
|
218
|
+
|
|
206
219
|
sslpsk
|
|
207
220
|
------
|
|
208
221
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
bareos/VERSION.txt,sha256=
|
|
1
|
+
bareos/VERSION.txt,sha256=a9sRw4SjTFGB0vx4IJGtUit2LnwI95xnO7sSpet0yK0,7
|
|
2
2
|
bareos/__init__.py,sha256=WPq-fXxGDZSIwfkXZkwJAZdGcVSeVBcLsTum5qOmX2I,1423
|
|
3
3
|
bareos/exceptions.py,sha256=3oeC_jXq2imzPxiqJmGTq4TsgFRtDlzwnAwumzYsB5M,4071
|
|
4
|
-
bareos/bsock/__init__.py,sha256=
|
|
4
|
+
bareos/bsock/__init__.py,sha256=r5UtyEkhqomYW5FYE7OmjsKon0vGfU1mgoj16A7WfKg,8979
|
|
5
5
|
bareos/bsock/bsock.py,sha256=SIAPU7ouXOW5ScnnpgtVbcugKmzXlNhSs6lrC0ofspw,1242
|
|
6
6
|
bareos/bsock/bsockjson.py,sha256=pnnX7b83dJH86pOw140CBz5etVJgafcQhXtKhr219TE,1289
|
|
7
7
|
bareos/bsock/connectiontype.py,sha256=PNEHpqZfuAHV310NaOMgMXj6VKiZxAZwXeRIOUfHJWI,1043
|
|
@@ -9,7 +9,7 @@ bareos/bsock/constants.py,sha256=U9RlPy8XYNkFCG1j6B89gI5cCiODVHyfQMWNumz7pbY,512
|
|
|
9
9
|
bareos/bsock/directorconsole.py,sha256=ou1IYXoMxgv46zws0ERrB28VWvrs0npA3iC1b5pLMz0,10368
|
|
10
10
|
bareos/bsock/directorconsolejson.py,sha256=LdsMIwHZeaK-y9ydwOVl7EndMavqb2_v98ZRqWL0G7o,4457
|
|
11
11
|
bareos/bsock/filedaemon.py,sha256=bl8QD97R3uc5qTFV2wN0mfi2C3ePJsjaN_bKeZAclsk,6067
|
|
12
|
-
bareos/bsock/lowlevel.py,sha256=
|
|
12
|
+
bareos/bsock/lowlevel.py,sha256=x7w2DrwDtTFmSx2R_gzJToH_PK0vInfkkt3QYWL-vsg,30661
|
|
13
13
|
bareos/bsock/protocolmessageids.py,sha256=WKlbo8qbgSL5V48fQnFXtyvjBBgIu_lOYzvQ8vQrGaQ,1228
|
|
14
14
|
bareos/bsock/protocolmessages.py,sha256=GgtstzAwA_gjOJCYQTG_wevsA6zTMn_bbz3E2yr8TCU,3008
|
|
15
15
|
bareos/bsock/protocolversions.py,sha256=7i5AaSnG9F-8WNVds7SJcezVzJU-SyjTNryJTNWikns,1030
|
|
@@ -20,11 +20,11 @@ bareos/util/bareosbase64.py,sha256=5bsv6-sxNJEnO1M3f0LyZP9CV6ZPyQ1axoi9Tfno4U8,3
|
|
|
20
20
|
bareos/util/password.py,sha256=w71h7KnVHNik37oRl0ljj8krBVslz6a2tB_1jBJBJfM,2531
|
|
21
21
|
bareos/util/path.py,sha256=nycMxK3V-P9Cx-CMsWo4e-IVlnl6_Im61pFUIPQEbL0,3099
|
|
22
22
|
bareos/util/version.py,sha256=xqNm9vvkaHMKpS0xJozQs11XrQYJR1U4j5oOUCnPiMw,1201
|
|
23
|
-
python_bareos-25.0.
|
|
24
|
-
python_bareos-25.0.
|
|
25
|
-
python_bareos-25.0.
|
|
26
|
-
python_bareos-25.0.
|
|
27
|
-
python_bareos-25.0.
|
|
28
|
-
python_bareos-25.0.
|
|
29
|
-
python_bareos-25.0.
|
|
30
|
-
python_bareos-25.0.
|
|
23
|
+
python_bareos-25.0.4.data/scripts/bareos-fd-connect.py,sha256=y7Jh2A-tkQeBNjyKYo8RsA7POHyDEYuOuy8ozjCEE1o,2127
|
|
24
|
+
python_bareos-25.0.4.data/scripts/bconsole-json.py,sha256=0vFaTeQvJYt_Vk3ldGefMb1rZbPhdO16FaT7dZH0b2k,1960
|
|
25
|
+
python_bareos-25.0.4.data/scripts/bconsole.py,sha256=m7ylVGq-ibYBbi1ZdkDdMC891WLZ3Cf5mg4IIe27i64,1993
|
|
26
|
+
python_bareos-25.0.4.dist-info/licenses/LICENSE.txt,sha256=V8j_M8nAz8PvAOZQocyRDX7keai8UJ9skgmnwqETmdY,34520
|
|
27
|
+
python_bareos-25.0.4.dist-info/METADATA,sha256=n3R4Kb7a0uDu4FOL6Qwj8ObqFyIpi5_HeF-y_06j-0U,8777
|
|
28
|
+
python_bareos-25.0.4.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
29
|
+
python_bareos-25.0.4.dist-info/top_level.txt,sha256=NlKJmA3FY973VTk-0zlxwwhDtFZHYVjpSNzgeMJsknY,7
|
|
30
|
+
python_bareos-25.0.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|