aboutsummaryrefslogtreecommitdiff
path: root/cc/util
AgeCommit message (Collapse)Author
2023-07-10Remove unused testonly target fake_kms_client_pybindambrosin
PiperOrigin-RevId: 546784430
2023-06-28util/SecretData code cleanupwiktorg
PiperOrigin-RevId: 544037037
2023-04-26Add TESTONLY attribute to CMake tink_cc_library targetsambrosin
This option excludes the target from being defined when TINK_BUILD_TESTS=OFF. PiperOrigin-RevId: 527197212
2023-03-08Remove the custom crypto::tink::util::Staus{|Or} implementationambrosin
Also remove Kokoro test scripts that used `--//config:tink_use_absl_statusor=True`. PiperOrigin-RevId: 515018353
2023-03-06Add utility function to generate a random prefix for test filesambrosin
When running tests with CMake, test files are created in /tmp. As a consequence, running tests in parallel is not possible due to the risk of tests using the same name for test files. This change adds a utility that generates unique test file name prefixes of the form `<test suite name>_<test name>_<random 32 bytes HEX>`. PiperOrigin-RevId: 514344312
2023-03-02Use different file names for ostream_output_stream_test and ↵ambrosin
file_output_stream_test Both tests write files with the same name to /tmp when running with CMake, and thus cannot run in parallel. PiperOrigin-RevId: 513521067
2023-02-14Replace std::abort/std::exit/std::_Exit with LOG/CHECK macros.wconner
PiperOrigin-RevId: 509597381
2023-02-08Use a tag to exclude targets on Windows when building with CMakeambrosin
PiperOrigin-RevId: 508006914
2023-02-06Skip file_*_stream and file_*_stream_test Bazel targets on Windowsambrosin
This is needed because these targets include a header not available on MSVC. PiperOrigin-RevId: 507409068
2023-02-01Look for `TEMP` and `TMP` env variables when returning the tmp dir path in testsambrosin
These env variables are set on Windows. PiperOrigin-RevId: 506306582
2023-02-01Exclude file_{input|output|random_access}_strem{|_test} targets from ↵ambrosin
building on Windows w/ CMake These file utility targets define InputStream and OutputStream implementations based on file POSIX APIs. They use `unistd.h` which MSVC doesn't provide. Rather than porting these targets on Windows, we decided to simply exclude file stream utility classes when building on Windows, leaving their implementation to the user of the library. PiperOrigin-RevId: 506283706
2023-01-25Remove usage of `unistd.h` from cc/util/test_utilambrosin
- Add an internal utility function to create a test file that uses the C++ STD streams-based APIs - Limit the use of `unistd.h` to util/file_*stream_test.cc #tinkApiChange PiperOrigin-RevId: 504491234
2023-01-20Fix DummyDecryptingRandomAccessStream and add unit testsambrosin
DummyDecryptingRandomAccessStream behaves incorrectly when reading all the content from the stream returns an EOF, and > 0 bytes are added to the buffer. PiperOrigin-RevId: 503585078
2023-01-18Cleanup includes for util/istream_input_stream_test.ccambrosin
PiperOrigin-RevId: 502860107
2023-01-18Improvements to util/file_input_stream_test.ccambrosin
- Add test cases for null `data` in `Next` and invalid file descriptor - Make tests parametrised on buffer size or stream size - Use more descriptive names for test cases - Split `testBackupAndPosition` into more focused test cases - Minor readability changes PiperOrigin-RevId: 502842017
2023-01-18Include only actually used headers in util/istream_input_stream.{cc|h}ambrosin
PiperOrigin-RevId: 502841856
2023-01-18Some improvements to util/file_input_stream.{cc|h}ambrosin
* Add check for `data` being nullptr and unit test for it * Default initialise class members * Use a std::vector<uint8_t> instead of a heap allocated array; remove buffer_size_ as no longer needed PiperOrigin-RevId: 502824318
2023-01-13Simplify ReadTestFile in cc/util/test_util.(h|cc)ambrosin
Use std libraries to read the file content. This should be a portable way to read test files. PiperOrigin-RevId: 501792823
2022-12-20Use `= default` for trivial ctor/dtors.wiktorg
PiperOrigin-RevId: 496635734
2022-12-16Remove now redundant `static_cast`swiktorg
All `StatusIs` matcher usages in Tink have been migrated to `absl::StatusCode`. Hopefully no user depends on this; if so we recommend users to migrate by replacing the call to "StatusIs" with the Tink error code with the corresponding absl::StatusCode. #tinkApiChange PiperOrigin-RevId: 495854000
2022-12-16Properly handle negation in IsOk matcherwiktorg
PiperOrigin-RevId: 495849973
2022-12-16Remove unused `using` declarationswiktorg
PiperOrigin-RevId: 495839092
2022-12-16IWYU: Add missing standard library includes.wiktorg
PiperOrigin-RevId: 495813578
2022-12-15Suppress bugprone errors in move behavior testswiktorg
PiperOrigin-RevId: 495603765
2022-12-13Migrate GetCancelled and GetUnknown to use the non-deprecated constructor.tholenst
While it doesn't really matter, this reduces the number of warnings compiling Tink produces. (We could also deprecate the functions, but it doesn't matter...) PiperOrigin-RevId: 495037904
2022-11-25Deprecate the constructor using a Tink error code.tholenst
PiperOrigin-RevId: 490913444
2022-11-25Deprecate some functions which do not exist if crypto::tink::util::Status is ↵tholenst
an alias for absl::Status. PiperOrigin-RevId: 490870998
2022-09-08Always use proto instead of ProtoLite in C++. We don't really use protolite ↵tholenst
here. PiperOrigin-RevId: 472919487
2022-06-22Remove .status() usages when matching IsOk() with a StatusOr object.kste
Since the IsOk() matcher can handle StatusOr now, we don't need to call .status() anymore. NOKEYCHECK NOKEYCHECK=True PiperOrigin-RevId: 456467311
2022-06-21Make IsOk matcher compatible with StatusOr.kste
This allows to use this matcher with a StatusOr. At the moment one needs to write: EXPECT_THAT(result.status(), IsOk()) and with this change this simplifies to EXPECT_THAT(result, IsOk()); PiperOrigin-RevId: 456207273
2022-05-11Replace | with ` for function arguments.cinlin
PiperOrigin-RevId: 448006786
2022-05-11Add comments to SecretValue.tholenst
PiperOrigin-RevId: 447963946
2022-05-06Some reorderings for consistency with google3.tholenst
PiperOrigin-RevId: 446937072
2022-05-05Fix some proto includes, and build targets.tholenst
PiperOrigin-RevId: 446655008
2022-04-29Add utility to serialize SecretProto as SecretDatawiktorg
PiperOrigin-RevId: 445347877
2022-03-31Add utility to create SecretProto from SecretDatawiktorg
PiperOrigin-RevId: 438516329
2022-03-28Fix deps sorting for Bazel targets `//util:test_util`, ↵ambrosin
`//prf:aes_cmac_prf_key_manager` and `//prf:hmac_prf_key_manager`. PiperOrigin-RevId: 437737651
2022-03-25Hide crypto::tink::util::StatusOr behind a compile-time option. Add the ↵lizatretyakova
corresponding option to the Bazel files, and use it in the kokoro test preventing slide-backs. Also, rename the test in order to reflect its updated functionality. Do not enable TINK_USE_ABSL_STATUSOR internally yet. This CL is a part of Tink migration to using absl::Status{,Or} and absl::StatusCode. PiperOrigin-RevId: 437234791
2022-03-22Make IsOkAndHolds() use the content type alias compatible with absl::StatusOr.lizatretyakova
Part of the Tink migration towards using absl::Status{,Or}. PiperOrigin-RevId: 436431372
2022-03-21Change crypto::tink::util::StatusOr::ValueOrDie() to value() in /tink/cc. ↵lizatretyakova
Part of Tink migration to absl::Status{,Or}. PiperOrigin-RevId: 436163579
2022-03-18Change crypto::tink::util::StatusOr::ValueOrDie() to value() in test ↵lizatretyakova
matchers. Part of Tink migration to absl::Status{,Or}. PiperOrigin-RevId: 435624054
2022-03-18Make crypto::tink::util::StatusOr::AbortWithMessageFrom const, in order to ↵lizatretyakova
allow usages of the const versions of value(). Part of the Tink migration towards absl::Status{,Or}. PiperOrigin-RevId: 435610472
2022-03-17Add value() method to crypto::tink::util::StatusOr, in order to make it ↵lizatretyakova
compatible with absl::StatusOr. Part of the Tink migration towards absl::Status{,Or}. PiperOrigin-RevId: 435321035
2022-02-22Hide crypto::tink::util::Status behind a compile-time option.lizatretyakova
This CL is a part of Tink migration to using absl::Status{,Or} and absl::StatusCode. NOKEYCHECK=True PiperOrigin-RevId: 430184794
2022-02-21Hide crypto::tink::util::Status behind a compile-time option.lizatretyakova
This CL is a part of Tink migration to using absl::Status{,Or} and absl::StatusCode. NOKEYCHECK=True PiperOrigin-RevId: 430084269
2022-02-21Hide crypto::tink::util::Status behind a compile-time option.lizatretyakova
This CL is a part of Tink migration to using absl::Status{,Or} and absl::StatusCode. NOKEYCHECK=True PiperOrigin-RevId: 430060593
2022-02-21Remove dangling references to crypto::tink::util::Status::error_message() in ↵lizatretyakova
tink/cc/util/. PiperOrigin-RevId: 430051924
2022-02-09Fix lint errors for Tink's Status and StatusOr.juerg
PiperOrigin-RevId: 427450320
2022-02-08Fix lint errors in includes.juerg
PiperOrigin-RevId: 427162077
2022-02-08Fix lint errors in includes.juerg
PiperOrigin-RevId: 427158594