MCPcopy Create free account
hub / github.com/bailey27/cppcryptfs / decrypt_stream_name

Function decrypt_stream_name

libcppcryptfs/filename/cryptfilename.cpp:1081–1111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1079}
1080
1081const WCHAR * // returns UNICODE plaintext stream name. input stream name is expected to start with colon
1082decrypt_stream_name(CryptContext *con, const BYTE *dir_iv, const WCHAR *stream, wstring& storage)
1083{
1084 if (!stream || stream[0] != ':')
1085 return NULL;
1086
1087 if (is_long_name(stream + 1))
1088 return NULL;
1089
1090 wstring stream_without_type;
1091 wstring type;
1092
1093 if (!remove_stream_type(stream, stream_without_type, type))
1094 return NULL;
1095
1096 LPCWSTR rs;
1097
1098 if (stream_without_type.length() > 1) {
1099 rs = decrypt_filename(con, dir_iv, NULL, stream_without_type.c_str() + 1, storage);
1100 } else {
1101 storage = L"";
1102 rs = storage.c_str();
1103 }
1104
1105 if (!rs)
1106 return NULL;
1107
1108 storage = L":" + storage + type;
1109
1110 return storage.c_str();
1111}

Callers 2

convert_find_stream_dataFunction · 0.85
decrypt_filenameFunction · 0.85

Calls 3

is_long_nameFunction · 0.85
remove_stream_typeFunction · 0.85
decrypt_filenameFunction · 0.85

Tested by

no test coverage detected