summaryrefslogtreecommitdiff
path: root/serializable.cpp
AgeCommit message (Collapse)Author
2015-06-22Add buffer wrap checks and disable throwing of std::bad_alloc.Shawn Willden
Android is built with exceptions disabled, but "operator new" and "operator new[]" still throw std::bad_alloc on failure rather than returning new. In general this is a good thing, because it will cause an immediate crash of the process rather than assigning a null pointer which is probably not checked. But most memory allocations in Keymaster are checked, because it's written to run in an environment where new does *not* throw. This CL updates the code to explicitly use the non-throwing new. A handful of throwing news remain, but only in places where a crash on failure is appropriate. In addition, this CL also inserts buffer wrap checks in key locations and changes the development-machine Makefile to build in 32-bit mode, to make memory problems more apparent. Bug: 21888473 Change-Id: I8ebc5ec12053e4f5274f6f57ce312abc10611cef
2015-05-18Remove references to Google in Android keymaster reference implementation.Shawn Willden
Change-Id: I05de61353fc806b90232fab7c1d1cf76aefa35fc
2015-01-22Remove redundant NULL checks on calls to memset_s.Shawn Willden
This change was already reviewed, merged and reverted, so I'm skipping the review step this time. Change-Id: I6f7ecb71fc03b9a821c81e1bc0f54952225d9da8
2015-01-20Revert "Remove redundant NULL checks on calls to memset_s."Shawn Willden
This reverts commit 356f6d4cf3d236e375a84e24b11359a5c1f1081f.
2014-12-30Remove redundant NULL checks on calls to memset_s.Shawn Willden
Change-Id: I04ef8e2bc640a1a6ef7fe32b37b4d84313ae20af
2014-08-26Reorganize system/keymaster.Shawn Willden
This CL moves the includes that should be exported to include/ and removes the trusty-specific code (some of which is moving to hardware/google and some of which is moving to the trusty tree.) Change-Id: Ie4fabf6b5c5f36b50c2f5ff356548ca2e9140fcb
2014-08-25Add some "fuzzing" tests for deserialization, and fixes for all of theShawn Willden
problems discovered. Change-Id: I050344f6c6d0a19b7f3304d23729b4ca71c05042
2014-08-18Housekeeping CL.Shawn Willden
Make variable names and formatting more consistent. Also, add doxygen comments to Serializable. Change-Id: I24ff138611111acf96112be74a04cc35f04908e0
2014-08-09Change authorization set serialization approach to ensure that 32 vs 64Shawn Willden
bit size and alignment differences don't cause problems. Change-Id: I4a308cfac782161db2f1456adb2d6a56537e61f1
2014-08-08Eliminate in-place serialization.Shawn Willden
Not doing in-place serialization will result in greater heap consumption, but eliminates many alignment-related issues. Given more time, I'd prefer to solve the alignment issues by computing and inserting appropriate padding, but we don't have the time. Change-Id: I86e4bdf57263db26c73372ae2963f21c5f5f00aa
2014-08-06Add AuthorizationSet class and some supporting utils and a Makefile forShawn Willden
running tests on the dev machine. Change-Id: I608e660854ace71409dd8bb5395d83dcfbf803c0