-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add a decryption function to use on a local esxi target #542
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #542 +/- ##
==========================================
+ Coverage 73.95% 73.98% +0.02%
==========================================
Files 284 284
Lines 23499 23521 +22
==========================================
+ Hits 17379 17401 +22
Misses 6120 6120
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
local_tgz = BytesIO( | ||
subprocess.run( | ||
["crypto-util", "envelope", "extract", "--aad", "ESXConfiguration", f"/{local_tgz_ve.as_posix()}", "-"], | ||
capture_output=True, | ||
).stdout | ||
) | ||
|
||
return local_tgz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
local_tgz = BytesIO( | |
subprocess.run( | |
["crypto-util", "envelope", "extract", "--aad", "ESXConfiguration", f"/{local_tgz_ve.as_posix()}", "-"], | |
capture_output=True, | |
).stdout | |
) | |
return local_tgz | |
result = subprocess.run( | |
["crypto-util", "envelope", "extract", "--aad", "ESXConfiguration", f"/{local_tgz_ve.as_posix()}", "-"], | |
capture_output=True, | |
) | |
return BytesIO(result.stdout) |
This maybe looks a bit nicer.
target.log.warning( | ||
"local.tgz is encrypted but static decryption failed, attempting dynamic decryption using crypto-util" | ||
) | ||
local_tgz = _decrypt_crypto_util(local_tgz_ve) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if this fails, btw? Maybe add a case and log message for that too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some checks for this specific case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the lint error
Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com>
2047aea
to
282ab97
Compare
(DIS-2995)