- /* Convert numerical OID string to an ASN1_OBJECT structure */
- tmpoid = OBJ_txt2obj(oid, 1);
- if (tmpoid == NULL)
- return 0;
+ if (oid != NULL) {
+ /* Convert numerical OID string to an ASN1_OBJECT structure */
+ tmpoid = OBJ_txt2obj(oid, 1);
+ if (tmpoid == NULL)
+ return 0;
+ } else {
+ /* Create a no-OID ASN1_OBJECT */
+ tmpoid = ASN1_OBJECT_new();
+ }