int STORE_ATTR_INFO_modify_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, BIGNUM *number) { if (!attrs) { STOREerr(STORE_F_STORE_ATTR_INFO_MODIFY_NUMBER, ERR_R_PASSED_NULL_PARAMETER); return 0; } if (ATTR_IS_SET(attrs, code)) { free(attrs->values[code].number); attrs->values[code].number = NULL; CLEAR_ATTRBIT(attrs, code); } return STORE_ATTR_INFO_set_number(attrs, code, number); }
int STORE_ATTR_INFO_modify_sha1str(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, unsigned char *sha1str, size_t sha1str_size) { if (!attrs) { STOREerr(STORE_F_STORE_ATTR_INFO_MODIFY_SHA1STR, ERR_R_PASSED_NULL_PARAMETER); return 0; } if (ATTR_IS_SET(attrs, code)) { free(attrs->values[code].sha1string); attrs->values[code].sha1string = NULL; CLEAR_ATTRBIT(attrs, code); } return STORE_ATTR_INFO_set_sha1str(attrs, code, sha1str, sha1str_size); }
int STORE_ATTR_INFO_modify_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, X509_NAME *dn) { if (!attrs) { STOREerr(STORE_F_STORE_ATTR_INFO_MODIFY_DN, ERR_R_PASSED_NULL_PARAMETER); return 0; } if (ATTR_IS_SET(attrs, code)) { free(attrs->values[code].dn); attrs->values[code].dn = NULL; CLEAR_ATTRBIT(attrs, code); } return STORE_ATTR_INFO_set_dn(attrs, code, dn); }
int STORE_ATTR_INFO_modify_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code, char *cstr, size_t cstr_size) { if (!attrs) { STOREerr(STORE_F_STORE_ATTR_INFO_MODIFY_CSTR, ERR_R_PASSED_NULL_PARAMETER); return 0; } if (ATTR_IS_SET(attrs,code)) { OPENSSL_free(attrs->values[code].cstring); attrs->values[code].cstring = NULL; CLEAR_ATTRBIT(attrs, code); } return STORE_ATTR_INFO_set_cstr(attrs, code, cstr, cstr_size); }