Hello,

Since protobuf library uses std::string for bytes fields, I'm wondering 
whether it is possible to securely clear the memory that contains sensitive 
data (e.g. secret keys)? 
At the moment, I use the following code just before protobuf object 
destruction:

for (volatile auto &c : buf.mutable_field()) c = '\0';

However, I'm not sure that it is enough since std::string can reinitialize 
memory freely during specific operations and leave its content uncleared. 
For protobuf object initialization, I use ParseFromArray method and I can 
definitely clear that initial array, but can I somehow ensure that a 
created protobuf object itself has all sensitive fields cleared?

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to