Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NXDRIVE-2930: Fix code scanning issue #4913

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changes/5.5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Release date: `2024-xx-xx`

- [NXDRIVE-2896](https://jira.nuxeo.com/browse/NXDRIVE-2896): Fix release build for upload/download artifact
- [NXDRIVE-2926] (https://jira.nuxeo.com/browse/NXDRIVE-2926): Update github Action Runner to use mac-latest
- [NXDRIVE-2930] (https://jira.nuxeo.com/browse/NXDRIVE-2930): Fix code scanning issue

## Tests

Expand Down
3 changes: 0 additions & 3 deletions nxdrive/client/remote_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,6 @@ def __init__(
auth = self.auth

self.verification_needed = get_verify()
log.info(
f"SSL verify: {verify}-> will be changed to {self.verification_needed}"
)

self.token = token

Expand Down
6 changes: 3 additions & 3 deletions nxdrive/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ def get_certificate_details(

def concat_all_certificates(files: List[Path]) -> Optional[Path]:
"""Craft a all-in-one certificate with ones from cacert and custom ones."""
from hashlib import md5
from hashlib import sha256

import certifi

Expand Down Expand Up @@ -707,7 +707,7 @@ def concat_all_certificates(files: List[Path]) -> Optional[Path]:
log.warning("No valid certificate found.")
return None

name = md5(certificates).hexdigest()
name = sha256(certificates).hexdigest()
folder = Options.nxdrive_home
final_file: Path = folder / f"ndrive_{name}.pem"

Expand All @@ -720,7 +720,7 @@ def concat_all_certificates(files: List[Path]) -> Optional[Path]:

log.info(f"Saved the final certificate to {str(final_file)!r}, including:")
for cert_file in cert_files:
log.info(f" >>> {str(cert_file)!r}")
log.debug(f" >>> {str(cert_file)!r}")
final_file.write_bytes(certificates)
else:
log.info(f"Will use the final certificate from {str(final_file)!r}")
Expand Down