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

Metadata does not contain full path to input and output files #120

Closed
juneb opened this issue Nov 19, 2017 · 1 comment
Closed

Metadata does not contain full path to input and output files #120

juneb opened this issue Nov 19, 2017 · 1 comment
Labels

Comments

@juneb
Copy link
Contributor

juneb commented Nov 19, 2017

aws-encryption-sdk-cli 1.0.2.7
Windows 10.0.14393.1884
PowerShell 5.0.14393.1884
Related to: #65

The README and AWS Encryption SDK docs say that the CLI metadata contains the full path to the input and output files. This might be a misunderstanding of "full path."

When my working directory is: C:\test and my input file is C:\test\secret.txt, I expect the full path to my input file to be C:\test\secret.txt.

PS C:\test> (dir .\secret.txt).FullName
C:\test\secret.txt

Instead, the value of the input node in the metadata is: secret.txt

PS C:\test> $json | fl

header : @{algorithm=AES_256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384; content_type=2;
         encrypted_data_keys=System.Object[]; encryption_context=; frame_length=4096; header_iv_length=12;
         message_id=cWFfuKH2c0slnN0RZ9intA==; type=128; version=1.0}
input  : secret.txt
mode   : encrypt
output : .\secret.txt.encrypted
@mattsb42-aws
Copy link
Member

Hmm, I thought checked this...apparently not. We'll want to make sure this is covered by tests before applying, but for reference while it's fresh in my head, the fix for this will be to update source file[1] and destination file[2] open calls to wrap the filename in os.path.abspath (we want abspath, not realpath so it displays as the file the caller specified rather than displaying the actual file following any symlinks).

[1] https://github.com/awslabs/aws-encryption-sdk-cli/blob/master/src/aws_encryption_sdk_cli/internal/io_handling.py#L332
[2] https://github.com/awslabs/aws-encryption-sdk-cli/blob/master/src/aws_encryption_sdk_cli/internal/io_handling.py#L257

@mattsb42-aws mattsb42-aws changed the title Metadata does not contain full path to input and output files (Windows) Metadata does not contain full path to input and output files Nov 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants