Todd Lipcon has posted comments on this change. Change subject: Use Traits to avoid duplicate code in SSL wrappers ......................................................................
Patch Set 3: (2 comments) http://gerrit.cloudera.org:8080/#/c/5767/3/src/kudu/security/ca/cert_management.cc File src/kudu/security/ca/cert_management.cc: PS3, Line 83: free > Would it make sense to add 'allocate' as well? hrm, I didn't see a place where it was useful to use this, and didn't want to add it just for symmetry. Is there a spot you see it would be useful? PS3, Line 135: switch (format) { : case DataFormat::DER: : CERT_RET_NOT_OK(Traits::write_der(bio, obj), "error exporting DER format"); : break; : case DataFormat::PEM: : CERT_RET_NOT_OK(Traits::write_pem(bio, obj), "error exporting PEM format"); : break; : } > Isn't that UB? I'm not a fan of default cases in situations like this, sin yea, I agree. when we are converting from the wire protocol, we should be conservative and have safety for unknown values, but within our own process I don't think we need to guard against illegal values. (this isn't a public-facing API where someone might pass something unexpected) -- To view, visit http://gerrit.cloudera.org:8080/5767 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: If1c44857358fc82f2694dff021b9f2ac3641313a Gerrit-PatchSet: 3 Gerrit-Project: kudu Gerrit-Branch: master Gerrit-Owner: Todd Lipcon <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Dan Burkert <[email protected]> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Todd Lipcon <[email protected]> Gerrit-HasComments: Yes
