projects
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1d48dd0
)
Another STACK bites the dust.
author
Ben Laurie
<ben@openssl.org>
Sat, 17 Apr 1999 10:28:46 +0000
(10:28 +0000)
committer
Ben Laurie
<ben@openssl.org>
Sat, 17 Apr 1999 10:28:46 +0000
(10:28 +0000)
crypto/asn1/asn1_mac.h
patch
|
blob
|
history
crypto/evp/evp.h
patch
|
blob
|
history
crypto/x509/x509.h
patch
|
blob
|
history
crypto/x509v3/v3_sxnet.c
patch
|
blob
|
history
crypto/x509v3/x509v3.h
patch
|
blob
|
history
diff --git
a/crypto/asn1/asn1_mac.h
b/crypto/asn1/asn1_mac.h
index 3aeedc18a68263de4c254b383c9c4a69c8b503ce..b7a90f820db4974341cc46c25aed02010e24a393 100644
(file)
--- a/
crypto/asn1/asn1_mac.h
+++ b/
crypto/asn1/asn1_mac.h
@@
-193,6
+193,10
@@
err:\
M_ASN1_D2I_get_imp_set(r,func,free_func,\
V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL);
M_ASN1_D2I_get_imp_set(r,func,free_func,\
V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL);
+#define M_ASN1_D2I_get_seq_type(type,r,func,free_func) \
+ M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\
+ V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL)
+
#define M_ASN1_D2I_get_seq_opt(r,func,free_func) \
if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \
V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\
#define M_ASN1_D2I_get_seq_opt(r,func,free_func) \
if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \
V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\
@@
-211,8
+215,8
@@
err:\
#define M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,a,b) \
c.q=c.p; \
#define M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,a,b) \
c.q=c.p; \
- if (d2i_ASN1_SET_OF_##type(&(r),&c.p,c.slen,func,
free_func,a,b)
\
- == NULL) \
+ if (d2i_ASN1_SET_OF_##type(&(r),&c.p,c.slen,func,\
+
free_func,a,b)
== NULL) \
{ c.line=__LINE__; goto err; } \
c.slen-=(c.p-c.q);
{ c.line=__LINE__; goto err; } \
c.slen-=(c.p-c.q);
@@
-309,6
+313,10
@@
err:\
ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \
IS_SEQUENCE);
ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \
IS_SEQUENCE);
+#define M_ASN1_I2D_len_SEQUENCE_type(type,a,f) \
+ ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SEQUENCE, \
+ V_ASN1_UNIVERSAL,IS_SEQUENCE)
+
#define M_ASN1_I2D_len_SEQUENCE_opt(a,f) \
if ((a != NULL) && (sk_num(a) != 0)) \
M_ASN1_I2D_len_SEQUENCE(a,f);
#define M_ASN1_I2D_len_SEQUENCE_opt(a,f) \
if ((a != NULL) && (sk_num(a) != 0)) \
M_ASN1_I2D_len_SEQUENCE(a,f);
@@
-379,6
+387,10
@@
err:\
#define M_ASN1_I2D_put_SEQUENCE(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SEQUENCE,\
V_ASN1_UNIVERSAL,IS_SEQUENCE)
#define M_ASN1_I2D_put_SEQUENCE(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SEQUENCE,\
V_ASN1_UNIVERSAL,IS_SEQUENCE)
+#define M_ASN1_I2D_put_SEQUENCE_type(type,a,f) \
+ i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \
+ IS_SEQUENCE)
+
#define M_ASN1_I2D_put_SEQUENCE_opt(a,f) \
if ((a != NULL) && (sk_num(a) != 0)) \
M_ASN1_I2D_put_SEQUENCE(a,f);
#define M_ASN1_I2D_put_SEQUENCE_opt(a,f) \
if ((a != NULL) && (sk_num(a) != 0)) \
M_ASN1_I2D_put_SEQUENCE(a,f);
diff --git
a/crypto/evp/evp.h
b/crypto/evp/evp.h
index 31ed4791a9809273d90a884ee82296ef9d9541d5..1188c35787a9edb4021f16722bca95071179c58c 100644
(file)
--- a/
crypto/evp/evp.h
+++ b/
crypto/evp/evp.h
@@
-164,11
+164,7
@@
typedef struct evp_pkey_st
struct dh_st *dh; /* DH */
} pkey;
int save_parameters;
struct dh_st *dh; /* DH */
} pkey;
int save_parameters;
-#ifdef HEADER_STACK_H
- STACK /* X509_ATTRIBUTE */ *attributes; /* [ 0 ] */
-#else
- char /* X509_ATTRIBUTE */ *attributes; /* [ 0 ] */
-#endif
+ STACK /*X509_ATTRIBUTE*/ *attributes; /* [ 0 ] */
} EVP_PKEY;
#define EVP_PKEY_MO_SIGN 0x0001
} EVP_PKEY;
#define EVP_PKEY_MO_SIGN 0x0001
diff --git
a/crypto/x509/x509.h
b/crypto/x509/x509.h
index 6486d2063ed7d1e7ef3525b23239eb066288c967..4d7b996e5170c2b20fdb7d1f69dfd71653bc9fec 100644
(file)
--- a/
crypto/x509/x509.h
+++ b/
crypto/x509/x509.h
@@
-126,7
+126,7
@@
typedef struct X509_pubkey_st
{
X509_ALGOR *algor;
ASN1_BIT_STRING *public_key;
{
X509_ALGOR *algor;
ASN1_BIT_STRING *public_key;
-
struct evp_pkey_st /* EVP_PKEY*/
*pkey;
+
EVP_PKEY
*pkey;
} X509_PUBKEY;
typedef struct X509_sig_st
} X509_PUBKEY;
typedef struct X509_sig_st
@@
-256,6
+256,8
@@
typedef struct x509_attributes_st
} value;
} X509_ATTRIBUTE;
} value;
} X509_ATTRIBUTE;
+DECLARE_STACK_OF(X509_ATTRIBUTE);
+
typedef struct private_key_st
{
int version;
typedef struct private_key_st
{
int version;
diff --git
a/crypto/x509v3/v3_sxnet.c
b/crypto/x509v3/v3_sxnet.c
index 443a5743286e61f126d9009c9fcf78a78ced7028..ac7aa7675241ac45910dde7c39c9c87716d0c916 100644
(file)
--- a/
crypto/x509v3/v3_sxnet.c
+++ b/
crypto/x509v3/v3_sxnet.c
@@
-109,12
+109,12
@@
unsigned char **pp;
M_ASN1_I2D_vars(a);
M_ASN1_I2D_len (a->version, i2d_ASN1_INTEGER);
M_ASN1_I2D_vars(a);
M_ASN1_I2D_len (a->version, i2d_ASN1_INTEGER);
- M_ASN1_I2D_len_SEQUENCE
(
a->ids, i2d_SXNETID);
+ M_ASN1_I2D_len_SEQUENCE
_type (SXNETID,
a->ids, i2d_SXNETID);
M_ASN1_I2D_seq_total();
M_ASN1_I2D_put (a->version, i2d_ASN1_INTEGER);
M_ASN1_I2D_seq_total();
M_ASN1_I2D_put (a->version, i2d_ASN1_INTEGER);
- M_ASN1_I2D_put_SEQUENCE
(
a->ids, i2d_SXNETID);
+ M_ASN1_I2D_put_SEQUENCE
_type (SXNETID,
a->ids, i2d_SXNETID);
M_ASN1_I2D_finish();
}
M_ASN1_I2D_finish();
}
@@
-125,7
+125,7
@@
SXNET *SXNET_new()
ASN1_CTX c;
M_ASN1_New_Malloc(ret, SXNET);
M_ASN1_New(ret->version,ASN1_INTEGER_new);
ASN1_CTX c;
M_ASN1_New_Malloc(ret, SXNET);
M_ASN1_New(ret->version,ASN1_INTEGER_new);
- M_ASN1_New(ret->ids,sk_new_null);
+ M_ASN1_New(ret->ids,sk_
SXNETID_
new_null);
return (ret);
M_ASN1_New_Error(ASN1_F_SXNET_NEW);
}
return (ret);
M_ASN1_New_Error(ASN1_F_SXNET_NEW);
}
@@
-139,7
+139,7
@@
long length;
M_ASN1_D2I_Init();
M_ASN1_D2I_start_sequence();
M_ASN1_D2I_get (ret->version, d2i_ASN1_INTEGER);
M_ASN1_D2I_Init();
M_ASN1_D2I_start_sequence();
M_ASN1_D2I_get (ret->version, d2i_ASN1_INTEGER);
- M_ASN1_D2I_get_seq
(
ret->ids, d2i_SXNETID, SXNETID_free);
+ M_ASN1_D2I_get_seq
_type (SXNETID,
ret->ids, d2i_SXNETID, SXNETID_free);
M_ASN1_D2I_Finish(a, SXNET_free, ASN1_F_D2I_SXNET);
}
M_ASN1_D2I_Finish(a, SXNET_free, ASN1_F_D2I_SXNET);
}
@@
-148,8
+148,8
@@
SXNET *a;
{
if (a == NULL) return;
ASN1_INTEGER_free(a->version);
{
if (a == NULL) return;
ASN1_INTEGER_free(a->version);
- sk_pop_free(a->ids, SXNETID_free);
- Free (
(char *)
a);
+ sk_
SXNETID_
pop_free(a->ids, SXNETID_free);
+ Free (a);
}
int i2d_SXNETID(a,pp)
}
int i2d_SXNETID(a,pp)
@@
-199,7
+199,7
@@
SXNETID *a;
if (a == NULL) return;
ASN1_INTEGER_free(a->zone);
ASN1_OCTET_STRING_free(a->user);
if (a == NULL) return;
ASN1_INTEGER_free(a->zone);
ASN1_OCTET_STRING_free(a->user);
- Free (
(char *)
a);
+ Free (a);
}
static int sxnet_i2r(method, sx, out, indent)
}
static int sxnet_i2r(method, sx, out, indent)
@@
-214,8
+214,8
@@
int indent;
int i;
v = ASN1_INTEGER_get(sx->version);
BIO_printf(out, "%*sVersion: %d (0x%X)", indent, "", v + 1, v);
int i;
v = ASN1_INTEGER_get(sx->version);
BIO_printf(out, "%*sVersion: %d (0x%X)", indent, "", v + 1, v);
- for(i = 0; i < sk_num(sx->ids); i++) {
- id =
(SXNETID *)sk
_value(sx->ids, i);
+ for(i = 0; i < sk_
SXNETID_
num(sx->ids); i++) {
+ id =
sk_SXNETID
_value(sx->ids, i);
tmp = i2s_ASN1_INTEGER(NULL, id->zone);
BIO_printf(out, "\n%*sZone: %s, User: ", indent, "", tmp);
Free(tmp);
tmp = i2s_ASN1_INTEGER(NULL, id->zone);
BIO_printf(out, "\n%*sZone: %s, User: ", indent, "", tmp);
Free(tmp);
@@
-323,7
+323,7
@@
int userlen;
if(userlen == -1) userlen = strlen(user);
if(!ASN1_OCTET_STRING_set(id->user, user, userlen)) goto err;
if(userlen == -1) userlen = strlen(user);
if(!ASN1_OCTET_STRING_set(id->user, user, userlen)) goto err;
- if(!sk_
push(sx->ids, (char *)
id)) goto err;
+ if(!sk_
SXNETID_push(sx->ids,
id)) goto err;
id->zone = zone;
return 1;
id->zone = zone;
return 1;
@@
-372,9
+372,12
@@
ASN1_INTEGER *zone;
{
SXNETID *id;
int i;
{
SXNETID *id;
int i;
- for(i = 0; i < sk_num(sx->ids); i++) {
- id =
(SXNETID *)sk
_value(sx->ids, 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;
}
return NULL;
}
if(!ASN1_INTEGER_cmp(id->zone, zone)) return id->user;
}
return NULL;
}
+
+IMPLEMENT_STACK_OF(SXNETID)
+IMPLEMENT_ASN1_SET_OF(SXNETID)
diff --git
a/crypto/x509v3/x509v3.h
b/crypto/x509v3/x509v3.h
index 5143a1e7abbd731779abfe76c9838568296e47ad..52037eccb34558fa2a58bdf118cbe4216315779d 100644
(file)
--- a/
crypto/x509v3/x509v3.h
+++ b/
crypto/x509v3/x509v3.h
@@
-184,16
+184,19
@@
union {
/* Strong extranet structures */
/* Strong extranet structures */
-typedef struct SXNET_st {
- ASN1_INTEGER *version;
- STACK /* SXNETID */ *ids;
-} SXNET;
-
typedef struct SXNET_ID_st {
ASN1_INTEGER *zone;
ASN1_OCTET_STRING *user;
} SXNETID;
typedef struct SXNET_ID_st {
ASN1_INTEGER *zone;
ASN1_OCTET_STRING *user;
} SXNETID;
+DECLARE_STACK_OF(SXNETID)
+DECLARE_ASN1_SET_OF(SXNETID)
+
+typedef struct SXNET_st {
+ ASN1_INTEGER *version;
+ STACK_OF(SXNETID) *ids;
+} SXNET;
+
#define X509V3_conf_err(val) ERR_add_error_data(6, "section:", val->section, \
",name:", val->name, ",value:", val->value);
#define X509V3_conf_err(val) ERR_add_error_data(6, "section:", val->section, \
",name:", val->name, ",value:", val->value);