The X509_ATTRIBUTE structure includes a hack to tolerate malformed attributes that encode the value directly instead of a set of values. This form is never created by OpenSSL and shouldn't be needed any more. (Imported from upstream's e20b57270dece66ce2c68aeb5d14dd6d9f3c5d68.) This also changes X509_ATTRIBUTE_set1_data slightly. Previously, set1_data would override whatever was previously in the X509_ATTRIBUTE, but leak memory. Now set1_data appends to the set. (PKCS#10 attributes use SET OF ANY as value.) It's unclear to me if this was intentional on upstream's part. (The attrtype == 0 case only makes sense in the old behavior.) Since there is no other way to create a two-element SET and upstream has long since released this behavior, I left it matching upstream. Update-Note: Given OpenSSL hasn't accepted these for five years, it's unlikely anything depends on it. If something breaks, we can revert this and revisit. No one calls X509_ATTRIBUTE_set1_data on a non-empty X509_ATTRIBUTE, so the behavior change there should be safe. Change-Id: Ic03c793b7d42784072ec0d9a7b6424aecc738632 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/46947 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: David Benjamin <davidben@google.com>grpc-202302
parent
575d112858
commit
b173d9191d
3 changed files with 7 additions and 41 deletions
Loading…
Reference in new issue