medicafe 0.250529.2__py3-none-any.whl → 0.250610.0__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.

Potentially problematic release.


This version of medicafe might be problematic. Click here for more details.

@@ -321,13 +321,40 @@ class RequestHandler(BaseHTTPRequestHandler):
321
321
  def generate_self_signed_cert(cert_file, key_file):
322
322
  log("Checking if certificate file exists: " + cert_file)
323
323
  log("Checking if key file exists: " + key_file)
324
- if not os.path.exists(cert_file) or not os.path.exists(key_file):
324
+
325
+ # Check if certificate exists and is not expired
326
+ cert_needs_regeneration = True
327
+ if os.path.exists(cert_file):
328
+ try:
329
+ # Check certificate expiration
330
+ check_cmd = ['openssl', 'x509', '-in', cert_file, '-checkend', '86400', '-noout'] # Check if expires in next 24 hours
331
+ result = subprocess.call(check_cmd)
332
+ if result == 0:
333
+ log("Certificate is still valid")
334
+ cert_needs_regeneration = False
335
+ else:
336
+ log("Certificate is expired or will expire soon")
337
+ # Delete expired certificate and key files
338
+ try:
339
+ if os.path.exists(cert_file):
340
+ os.remove(cert_file)
341
+ log("Deleted expired certificate file: {}".format(cert_file))
342
+ if os.path.exists(key_file):
343
+ os.remove(key_file)
344
+ log("Deleted expired key file: {}".format(key_file))
345
+ except Exception as e:
346
+ log("Error deleting expired certificate files: {}".format(e))
347
+ except Exception as e:
348
+ log("Error checking certificate expiration: {}".format(e))
349
+
350
+ if cert_needs_regeneration:
325
351
  log("Generating self-signed SSL certificate...")
326
352
  cmd = [
327
353
  'openssl', 'req', '-config', openssl_cnf, '-nodes', '-new', '-x509',
328
354
  '-keyout', key_file,
329
355
  '-out', cert_file,
330
- '-days', '365'
356
+ '-days', '365',
357
+ '-sha256' # Use SHA-256 for better security
331
358
  #'-subj', '/C=US/ST=...' The openssl.cnf file contains default values for these fields, but they can be overridden by the -subj option.
332
359
  ]
333
360
  try:
@@ -336,7 +363,14 @@ def generate_self_signed_cert(cert_file, key_file):
336
363
  log("Command finished with result: " + str(result))
337
364
  if result != 0:
338
365
  raise RuntimeError("Failed to generate self-signed certificate")
339
- log("Self-signed SSL certificate generated.")
366
+
367
+ # Verify the certificate was generated correctly
368
+ verify_cmd = ['openssl', 'x509', '-in', cert_file, '-text', '-noout']
369
+ verify_result = subprocess.call(verify_cmd)
370
+ if verify_result != 0:
371
+ raise RuntimeError("Generated certificate verification failed")
372
+
373
+ log("Self-signed SSL certificate generated and verified successfully.")
340
374
  except Exception as e:
341
375
  log("Error generating self-signed certificate: {}".format(e))
342
376
  raise
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: medicafe
3
- Version: 0.250529.2
3
+ Version: 0.250610.0
4
4
  Summary: MediCafe
5
5
  Home-page: https://github.com/katanada2
6
6
  Author: Daniel Vidaud
@@ -29,7 +29,7 @@ MediLink/MediLink_Decoder.py,sha256=Suw9CmUHgoe0ZW8sJP_pIO8URBrhO5FmxFF8RcUj9lI,
29
29
  MediLink/MediLink_Deductible.py,sha256=G1l7shl6uvMBO4R14CcKJ41lRW2AiR9Ahg1tHsETZzo,13490
30
30
  MediLink/MediLink_Down.py,sha256=hrDODhs-zRfOKCdiRGENN5Czu-AvdtwJj4Q7grcRXME,6518
31
31
  MediLink/MediLink_ERA_decoder.py,sha256=MiOtDcXnmevPfHAahIlTLlUc14VcQWAor9Xa7clA2Ts,8710
32
- MediLink/MediLink_Gmail.py,sha256=sfyt4g7GPhyWk6De5SxvnU4EQB-RWyvpDcrWvD7Zbzw,29317
32
+ MediLink/MediLink_Gmail.py,sha256=f6xs92652EiOnPt5zSa0wmBlArKKUmlxrYDuHNwVJ3g,30938
33
33
  MediLink/MediLink_Mailer.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
34
  MediLink/MediLink_Parser.py,sha256=YCg2jvoJUi048GICUmP0v71b-hGqwxUQelhoi3P33i4,8128
35
35
  MediLink/MediLink_Scan.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -41,8 +41,8 @@ MediLink/MediLink_batch.bat,sha256=nqL5QwCLyRQFSPdv6kgtcV_cpky7FXSOWVl6OxjRXb4,1
41
41
  MediLink/Soumit_api.py,sha256=5JfOecK98ZC6NpZklZW2AkOzkjvrbYxpJpZNH3rFxDw,497
42
42
  MediLink/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
43
  MediLink/test.py,sha256=kSvvJRL_3fWuNS3_x4hToOnUljGLoeEw6SUTHQWQRJk,3108
44
- medicafe-0.250529.2.dist-info/LICENSE,sha256=65lb-vVujdQK7uMH3RRJSMwUW-WMrMEsc5sOaUn2xUk,1096
45
- medicafe-0.250529.2.dist-info/METADATA,sha256=2Z8rcfCru9dKCUFxGlDda91jEPVD0cY9t2V2MWF7o-s,5501
46
- medicafe-0.250529.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
47
- medicafe-0.250529.2.dist-info/top_level.txt,sha256=3uOwR4q_SP8Gufk2uCHoKngAgbtdOwQC6Qjl7ViBa_c,17
48
- medicafe-0.250529.2.dist-info/RECORD,,
44
+ medicafe-0.250610.0.dist-info/LICENSE,sha256=65lb-vVujdQK7uMH3RRJSMwUW-WMrMEsc5sOaUn2xUk,1096
45
+ medicafe-0.250610.0.dist-info/METADATA,sha256=PY51ul1s5v2ChX6j1xgbhZFbTnQ2WLE4z0hlU3uZJuE,5501
46
+ medicafe-0.250610.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
47
+ medicafe-0.250610.0.dist-info/top_level.txt,sha256=3uOwR4q_SP8Gufk2uCHoKngAgbtdOwQC6Qjl7ViBa_c,17
48
+ medicafe-0.250610.0.dist-info/RECORD,,