python-bareos 25.0.3__tar.gz → 25.0.4__tar.gz

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.
Files changed (36) hide show
  1. {python_bareos-25.0.3 → python_bareos-25.0.4}/PKG-INFO +15 -2
  2. python_bareos-25.0.4/bareos/VERSION.txt +1 -0
  3. {python_bareos-25.0.3 → python_bareos-25.0.4}/bareos/bsock/__init__.py +15 -2
  4. {python_bareos-25.0.3 → python_bareos-25.0.4}/bareos/bsock/lowlevel.py +36 -20
  5. {python_bareos-25.0.3 → python_bareos-25.0.4}/python_bareos.egg-info/PKG-INFO +15 -2
  6. python_bareos-25.0.3/bareos/VERSION.txt +0 -1
  7. {python_bareos-25.0.3 → python_bareos-25.0.4}/LICENSE.txt +0 -0
  8. {python_bareos-25.0.3 → python_bareos-25.0.4}/README.rst +0 -0
  9. {python_bareos-25.0.3 → python_bareos-25.0.4}/bareos/__init__.py +0 -0
  10. {python_bareos-25.0.3 → python_bareos-25.0.4}/bareos/bsock/bsock.py +0 -0
  11. {python_bareos-25.0.3 → python_bareos-25.0.4}/bareos/bsock/bsockjson.py +0 -0
  12. {python_bareos-25.0.3 → python_bareos-25.0.4}/bareos/bsock/connectiontype.py +0 -0
  13. {python_bareos-25.0.3 → python_bareos-25.0.4}/bareos/bsock/constants.py +0 -0
  14. {python_bareos-25.0.3 → python_bareos-25.0.4}/bareos/bsock/directorconsole.py +0 -0
  15. {python_bareos-25.0.3 → python_bareos-25.0.4}/bareos/bsock/directorconsolejson.py +0 -0
  16. {python_bareos-25.0.3 → python_bareos-25.0.4}/bareos/bsock/filedaemon.py +0 -0
  17. {python_bareos-25.0.3 → python_bareos-25.0.4}/bareos/bsock/protocolmessageids.py +0 -0
  18. {python_bareos-25.0.3 → python_bareos-25.0.4}/bareos/bsock/protocolmessages.py +0 -0
  19. {python_bareos-25.0.3 → python_bareos-25.0.4}/bareos/bsock/protocolversions.py +0 -0
  20. {python_bareos-25.0.3 → python_bareos-25.0.4}/bareos/bsock/tlsversionparser.py +0 -0
  21. {python_bareos-25.0.3 → python_bareos-25.0.4}/bareos/exceptions.py +0 -0
  22. {python_bareos-25.0.3 → python_bareos-25.0.4}/bareos/util/__init__.py +0 -0
  23. {python_bareos-25.0.3 → python_bareos-25.0.4}/bareos/util/argparse.py +0 -0
  24. {python_bareos-25.0.3 → python_bareos-25.0.4}/bareos/util/bareosbase64.py +0 -0
  25. {python_bareos-25.0.3 → python_bareos-25.0.4}/bareos/util/password.py +0 -0
  26. {python_bareos-25.0.3 → python_bareos-25.0.4}/bareos/util/path.py +0 -0
  27. {python_bareos-25.0.3 → python_bareos-25.0.4}/bareos/util/version.py +0 -0
  28. {python_bareos-25.0.3 → python_bareos-25.0.4}/bin/bareos-fd-connect.py +0 -0
  29. {python_bareos-25.0.3 → python_bareos-25.0.4}/bin/bconsole-json.py +0 -0
  30. {python_bareos-25.0.3 → python_bareos-25.0.4}/bin/bconsole.py +0 -0
  31. {python_bareos-25.0.3 → python_bareos-25.0.4}/python_bareos.egg-info/SOURCES.txt +0 -0
  32. {python_bareos-25.0.3 → python_bareos-25.0.4}/python_bareos.egg-info/dependency_links.txt +0 -0
  33. {python_bareos-25.0.3 → python_bareos-25.0.4}/python_bareos.egg-info/requires.txt +0 -0
  34. {python_bareos-25.0.3 → python_bareos-25.0.4}/python_bareos.egg-info/top_level.txt +0 -0
  35. {python_bareos-25.0.3 → python_bareos-25.0.4}/setup.cfg +0 -0
  36. {python_bareos-25.0.3 → python_bareos-25.0.4}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-bareos
3
- Version: 25.0.3
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 module ``sslpsk`` (see https://github.com/drbild/sslpsk) offers limited support.
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
 
@@ -0,0 +1 @@
1
+ 25.0.4
@@ -1,6 +1,6 @@
1
1
  # BAREOS - Backup Archiving REcovery Open Sourced
2
2
  #
3
- # Copyright (C) 2016-2024 Bareos GmbH & Co. KG
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 module ``sslpsk`` (see https://github.com/drbild/sslpsk) offers limited support.
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
 
@@ -1,6 +1,6 @@
1
1
  # BAREOS - Backup Archiving REcovery Open Sourced
2
2
  #
3
- # Copyright (C) 2015-2024 Bareos GmbH & Co. KG
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 sslpsk
63
+ import sslpsk3
64
64
  except ImportError:
65
- warnings.warn(
66
- "Connection encryption via TLS-PSK is not available "
67
- "(not available in 'ssl' and extra module 'sslpsk' is not installed)."
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
- try:
289
- self.socket = sslpsk.wrap_socket(
290
- client_socket,
291
- ssl_version=self.tls_version,
292
- ciphers=ciphers,
293
- psk=(password, identity),
294
- server_side=False,
295
- )
296
- except ssl.SSLError as e:
297
- # raise ConnectionError(
298
- # "failed to connect to host {0}, port {1}: {2}".format(self.address, self.port, str(e)))
299
- # Using a general raise to keep more information about the type of error.
300
- raise
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 getattr(ssl, "HAS_PSK", False) or ("sslpsk" in sys.modules)
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
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 module ``sslpsk`` (see https://github.com/drbild/sslpsk) offers limited support.
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 +0,0 @@
1
- 25.0.3
File without changes
File without changes