static int sxnet_i2r(X509V3_EXT_METHOD *method, SXNET *sx, BIO *out, int indent);
#ifdef SXNET_TEST
-static SXNET * sxnet_v2i(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, STACK *nval);
+static SXNET * sxnet_v2i(X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
+ STACK_OF(CONF_VALUE) *nval);
#endif
X509V3_EXT_METHOD v3_sxnet = {
NID_sxnet, X509V3_EXT_MULTILINE,
(X509V3_EXT_NEW)SXNET_new,
-SXNET_free,
+(X509V3_EXT_FREE)SXNET_free,
(X509V3_EXT_D2I)d2i_SXNET,
-i2d_SXNET,
+(X509V3_EXT_I2D)i2d_SXNET,
NULL, NULL,
NULL,
#ifdef SXNET_TEST
SXNET *ret=NULL;
ASN1_CTX c;
M_ASN1_New_Malloc(ret, SXNET);
- M_ASN1_New(ret->version,ASN1_INTEGER_new);
+ M_ASN1_New(ret->version,M_ASN1_INTEGER_new);
M_ASN1_New(ret->ids,sk_SXNETID_new_null);
return (ret);
M_ASN1_New_Error(ASN1_F_SXNET_NEW);
void SXNET_free(SXNET *a)
{
if (a == NULL) return;
- ASN1_INTEGER_free(a->version);
+ M_ASN1_INTEGER_free(a->version);
sk_SXNETID_pop_free(a->ids, SXNETID_free);
Free (a);
}
ASN1_CTX c;
M_ASN1_New_Malloc(ret, SXNETID);
ret->zone = NULL;
- M_ASN1_New(ret->user,ASN1_OCTET_STRING_new);
+ M_ASN1_New(ret->user,M_ASN1_OCTET_STRING_new);
return (ret);
M_ASN1_New_Error(ASN1_F_SXNETID_NEW);
}
void SXNETID_free(SXNETID *a)
{
if (a == NULL) return;
- ASN1_INTEGER_free(a->zone);
- ASN1_OCTET_STRING_free(a->user);
+ M_ASN1_INTEGER_free(a->zone);
+ M_ASN1_OCTET_STRING_free(a->user);
Free (a);
}
tmp = i2s_ASN1_INTEGER(NULL, id->zone);
BIO_printf(out, "\n%*sZone: %s, User: ", indent, "", tmp);
Free(tmp);
- ASN1_OCTET_STRING_print(out, id->user);
+ M_ASN1_OCTET_STRING_print(out, id->user);
}
return 1;
}
static SXNET * sxnet_v2i(X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
- STACK *nval)
+ STACK_OF(CONF_VALUE) *nval)
{
CONF_VALUE *cnf;
SXNET *sx = NULL;
int i;
- for(i = 0; i < sk_num(nval); i++) {
- cnf = (CONF_VALUE *)sk_value(nval, i);
+ for(i = 0; i < sk_CONF_VALUE_num(nval); i++) {
+ cnf = sk_CONF_VALUE_value(nval, i);
if(!SXNET_add_id_asc(&sx, cnf->name, cnf->value, -1))
return NULL;
}
int userlen)
{
ASN1_INTEGER *izone = NULL;
- if(!(izone = ASN1_INTEGER_new()) || !ASN1_INTEGER_set(izone, lzone)) {
+ if(!(izone = M_ASN1_INTEGER_new()) || !ASN1_INTEGER_set(izone, lzone)) {
X509V3err(X509V3_F_SXNET_ADD_ID_ULONG,ERR_R_MALLOC_FAILURE);
- ASN1_INTEGER_free(izone);
+ M_ASN1_INTEGER_free(izone);
return 0;
}
return SXNET_add_id_INTEGER(psx, izone, user, userlen);
if(!(id = SXNETID_new())) goto err;
if(userlen == -1) userlen = strlen(user);
- if(!ASN1_OCTET_STRING_set(id->user, user, userlen)) goto err;
+ if(!M_ASN1_OCTET_STRING_set(id->user, user, userlen)) goto err;
if(!sk_SXNETID_push(sx->ids, id)) goto err;
id->zone = zone;
return 1;
return NULL;
}
oct = SXNET_get_id_INTEGER(sx, izone);
- ASN1_INTEGER_free(oct);
+ M_ASN1_INTEGER_free(izone);
return oct;
}
{
ASN1_INTEGER *izone = NULL;
ASN1_OCTET_STRING *oct;
- if(!(izone = ASN1_INTEGER_new()) || !ASN1_INTEGER_set(izone, lzone)) {
+ if(!(izone = M_ASN1_INTEGER_new()) || !ASN1_INTEGER_set(izone, lzone)) {
X509V3err(X509V3_F_SXNET_GET_ID_ULONG,ERR_R_MALLOC_FAILURE);
- ASN1_INTEGER_free(izone);
+ M_ASN1_INTEGER_free(izone);
return NULL;
}
oct = SXNET_get_id_INTEGER(sx, izone);
- ASN1_INTEGER_free(oct);
+ M_ASN1_INTEGER_free(izone);
return oct;
}
int i;
for(i = 0; i < sk_SXNETID_num(sx->ids); i++) {
id = sk_SXNETID_value(sx->ids, i);
- if(!ASN1_INTEGER_cmp(id->zone, zone)) return id->user;
+ if(!M_ASN1_INTEGER_cmp(id->zone, zone)) return id->user;
}
return NULL;
}