diff options
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | apps/pkcs12.c | 2 | ||||
-rw-r--r-- | apps/req.c | 4 | ||||
-rw-r--r-- | apps/smime.c | 4 | ||||
-rw-r--r-- | apps/verify.c | 4 | ||||
-rw-r--r-- | apps/x509.c | 6 | ||||
-rw-r--r-- | crypto/asn1/x_pubkey.c | 8 | ||||
-rw-r--r-- | crypto/asn1/x_x509a.c | 4 | ||||
-rw-r--r-- | crypto/evp/evp.h | 18 | ||||
-rw-r--r-- | crypto/evp/evp_err.c | 6 | ||||
-rw-r--r-- | crypto/evp/p_lib.c | 18 | ||||
-rw-r--r-- | crypto/pem/pem_all.c | 4 | ||||
-rw-r--r-- | crypto/pkcs7/pk7_smime.c | 14 | ||||
-rw-r--r-- | crypto/pkcs7/pkcs7.h | 4 | ||||
-rw-r--r-- | crypto/pkcs7/pkcs7err.c | 2 | ||||
-rw-r--r-- | crypto/x509/x509.h | 36 | ||||
-rw-r--r-- | crypto/x509/x509_att.c | 36 | ||||
-rw-r--r-- | crypto/x509/x509_err.c | 4 | ||||
-rw-r--r-- | crypto/x509/x509_req.c | 16 | ||||
-rw-r--r-- | crypto/x509/x509_trs.c | 2 | ||||
-rw-r--r-- | crypto/x509/x509_vfy.c | 2 | ||||
-rw-r--r-- | crypto/x509/x509_vfy.h | 2 | ||||
-rw-r--r-- | crypto/x509v3/v3_purp.c | 4 | ||||
-rw-r--r-- | crypto/x509v3/x509v3.h | 4 | ||||
-rwxr-xr-x | util/libeay.num | 52 |
25 files changed, 131 insertions, 128 deletions
@@ -4,6 +4,9 @@ Changes between 0.9.4 and 0.9.5 [xx XXX 2000] + *) Change function names to the new naming convention. + [Steve Henson] + *) Allow for the possibility of temp RSA key generation failure: the code used to assume it always worked and crashed on failure. [Steve Henson] diff --git a/apps/pkcs12.c b/apps/pkcs12.c index aefad61e15..d535a71335 100644 --- a/apps/pkcs12.c +++ b/apps/pkcs12.c @@ -693,7 +693,7 @@ int get_cert_chain (X509 *cert, STACK_OF(X509) **chain) i = X509_STORE_CTX_get_error (&store_ctx); goto err; } - chn = X509_STORE_CTX_rget_chain(&store_ctx); + chn = X509_STORE_CTX_get1_chain(&store_ctx); i = 0; *chain = chn; err: diff --git a/apps/req.c b/apps/req.c index 79a7394088..97bb0d0ed8 100644 --- a/apps/req.c +++ b/apps/req.c @@ -1103,7 +1103,7 @@ static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *dn_sk, for (i = 0; i < sk_CONF_VALUE_num(attr_sk); i++) { v=sk_CONF_VALUE_value(attr_sk,i); - if(!X509_REQ_radd_attr_by_txt(req, v->name, MBSTRING_ASC, + if(!X509_REQ_add1_attr_by_txt(req, v->name, MBSTRING_ASC, (unsigned char *)v->value, -1)) return 0; } } @@ -1201,7 +1201,7 @@ start: buf[--i]='\0'; if(!req_check_len(i, min, max)) goto start; - if(!X509_REQ_radd_attr_by_NID(req, nid, MBSTRING_ASC, + if(!X509_REQ_add1_attr_by_NID(req, nid, MBSTRING_ASC, (unsigned char *)buf, -1)) { BIO_printf(bio_err, "Error adding attribute\n"); ERR_print_errors(bio_err); diff --git a/apps/smime.c b/apps/smime.c index f0c3027c51..77633cfb60 100644 --- a/apps/smime.c +++ b/apps/smime.c @@ -488,9 +488,9 @@ int MAIN(int argc, char **argv) } #ifdef CRYPTO_MDEBUG CRYPTO_pop_info(); - CRYPTO_push_info("PKCS7_iget_signers"); + CRYPTO_push_info("PKCS7_get0_signers"); #endif - signers = PKCS7_iget_signers(p7, other, flags); + signers = PKCS7_get0_signers(p7, other, flags); #ifdef CRYPTO_MDEBUG CRYPTO_pop_info(); CRYPTO_push_info("save_certs"); diff --git a/apps/verify.c b/apps/verify.c index df596ca042..c2b19a1b07 100644 --- a/apps/verify.c +++ b/apps/verify.c @@ -191,8 +191,8 @@ end: for(i = 0; i < X509_PURPOSE_get_count(); i++) { X509_PURPOSE *ptmp; ptmp = X509_PURPOSE_iget(i); - BIO_printf(bio_err, "\t%-10s\t%s\n", X509_PURPOSE_iget_sname(ptmp), - X509_PURPOSE_iget_name(ptmp)); + BIO_printf(bio_err, "\t%-10s\t%s\n", X509_PURPOSE_get0_sname(ptmp), + X509_PURPOSE_get0_name(ptmp)); } } if (cert_ctx != NULL) X509_STORE_free(cert_ctx); diff --git a/apps/x509.c b/apps/x509.c index 450d6d44d1..407f839504 100644 --- a/apps/x509.c +++ b/apps/x509.c @@ -563,14 +563,14 @@ bad: if(trust) { for(i = 0; i < sk_ASN1_OBJECT_num(trust); i++) { objtmp = sk_ASN1_OBJECT_value(trust, i); - X509_radd_trust_object(x, objtmp); + X509_add1_trust_object(x, objtmp); } } if(reject) { for(i = 0; i < sk_ASN1_OBJECT_num(reject); i++) { objtmp = sk_ASN1_OBJECT_value(reject, i); - X509_radd_reject_object(x, objtmp); + X509_add1_reject_object(x, objtmp); } } @@ -1235,7 +1235,7 @@ static int purpose_print(BIO *bio, X509 *cert, X509_PURPOSE *pt) int id, i, idret; char *pname; id = X509_PURPOSE_get_id(pt); - pname = X509_PURPOSE_iget_name(pt); + pname = X509_PURPOSE_get0_name(pt); for(i = 0; i < 2; i++) { idret = X509_check_purpose(cert, id, i); BIO_printf(bio, "%s%s : ", pname, i ? " CA" : ""); diff --git a/crypto/asn1/x_pubkey.c b/crypto/asn1/x_pubkey.c index b96634b34c..81e9815222 100644 --- a/crypto/asn1/x_pubkey.c +++ b/crypto/asn1/x_pubkey.c @@ -297,7 +297,7 @@ RSA *d2i_RSA_PUBKEY(RSA **a, unsigned char **pp, q = *pp; pkey = d2i_PUBKEY(NULL, &q, length); if(!pkey) return NULL; - key = EVP_PKEY_rget_RSA(pkey); + key = EVP_PKEY_get1_RSA(pkey); EVP_PKEY_free(pkey); if(!key) return NULL; *pp = q; @@ -318,7 +318,7 @@ int i2d_RSA_PUBKEY(RSA *a, unsigned char **pp) ASN1err(ASN1_F_I2D_RSA_PUBKEY, ERR_R_MALLOC_FAILURE); return 0; } - EVP_PKEY_rset_RSA(pktmp, a); + EVP_PKEY_set1_RSA(pktmp, a); ret = i2d_PUBKEY(pktmp, pp); EVP_PKEY_free(pktmp); return ret; @@ -335,7 +335,7 @@ DSA *d2i_DSA_PUBKEY(DSA **a, unsigned char **pp, q = *pp; pkey = d2i_PUBKEY(NULL, &q, length); if(!pkey) return NULL; - key = EVP_PKEY_rget_DSA(pkey); + key = EVP_PKEY_get1_DSA(pkey); EVP_PKEY_free(pkey); if(!key) return NULL; *pp = q; @@ -356,7 +356,7 @@ int i2d_DSA_PUBKEY(DSA *a, unsigned char **pp) ASN1err(ASN1_F_I2D_DSA_PUBKEY, ERR_R_MALLOC_FAILURE); return 0; } - EVP_PKEY_rset_DSA(pktmp, a); + EVP_PKEY_set1_DSA(pktmp, a); ret = i2d_PUBKEY(pktmp, pp); EVP_PKEY_free(pktmp); return ret; diff --git a/crypto/asn1/x_x509a.c b/crypto/asn1/x_x509a.c index 84af2929e1..f3bd3f89b5 100644 --- a/crypto/asn1/x_x509a.c +++ b/crypto/asn1/x_x509a.c @@ -160,7 +160,7 @@ unsigned char *X509_alias_iget(X509 *x, int *len) return x->aux->alias->data; } -int X509_radd_trust_object(X509 *x, ASN1_OBJECT *obj) +int X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj) { X509_CERT_AUX *aux; ASN1_OBJECT *objtmp; @@ -171,7 +171,7 @@ int X509_radd_trust_object(X509 *x, ASN1_OBJECT *obj) return sk_ASN1_OBJECT_push(aux->trust, objtmp); } -int X509_radd_reject_object(X509 *x, ASN1_OBJECT *obj) +int X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj) { X509_CERT_AUX *aux; ASN1_OBJECT *objtmp; diff --git a/crypto/evp/evp.h b/crypto/evp/evp.h index 88d6d7f896..b391adce4a 100644 --- a/crypto/evp/evp.h +++ b/crypto/evp/evp.h @@ -617,16 +617,16 @@ int EVP_PKEY_bits(EVP_PKEY *pkey); int EVP_PKEY_size(EVP_PKEY *pkey); int EVP_PKEY_assign(EVP_PKEY *pkey,int type,char *key); #ifndef NO_RSA -int EVP_PKEY_rset_RSA(EVP_PKEY *pkey,RSA *key); -RSA * EVP_PKEY_rget_RSA(EVP_PKEY *pkey); +int EVP_PKEY_set1_RSA(EVP_PKEY *pkey,RSA *key); +RSA * EVP_PKEY_get1_RSA(EVP_PKEY *pkey); #endif #ifndef NO_DSA -int EVP_PKEY_rset_DSA(EVP_PKEY *pkey,DSA *key); -DSA * EVP_PKEY_rget_DSA(EVP_PKEY *pkey); +int EVP_PKEY_set1_DSA(EVP_PKEY *pkey,DSA *key); +DSA * EVP_PKEY_get1_DSA(EVP_PKEY *pkey); #endif #ifndef NO_DH -int EVP_PKEY_rset_DH(EVP_PKEY *pkey,DH *key); -DH * EVP_PKEY_rget_DH(EVP_PKEY *pkey); +int EVP_PKEY_set1_DH(EVP_PKEY *pkey,DH *key); +DH * EVP_PKEY_get1_DH(EVP_PKEY *pkey); #endif EVP_PKEY * EVP_PKEY_new(void); void EVP_PKEY_free(EVP_PKEY *pkey); @@ -695,9 +695,9 @@ void EVP_PBE_cleanup(void); #define EVP_F_EVP_PKEY_DECRYPT 104 #define EVP_F_EVP_PKEY_ENCRYPT 105 #define EVP_F_EVP_PKEY_NEW 106 -#define EVP_F_EVP_PKEY_RGET_DH 119 -#define EVP_F_EVP_PKEY_RGET_DSA 120 -#define EVP_F_EVP_PKEY_RGET_RSA 121 +#define EVP_F_EVP_PKEY_GET1_DH 119 +#define EVP_F_EVP_PKEY_GET1_DSA 120 +#define EVP_F_EVP_PKEY_GET1_RSA 121 #define EVP_F_EVP_SIGNFINAL 107 #define EVP_F_EVP_VERIFYFINAL 108 #define EVP_F_PKCS5_PBE_KEYIVGEN 117 diff --git a/crypto/evp/evp_err.c b/crypto/evp/evp_err.c index d3e3abbaec..2ff591ac58 100644 --- a/crypto/evp/evp_err.c +++ b/crypto/evp/evp_err.c @@ -78,9 +78,9 @@ static ERR_STRING_DATA EVP_str_functs[]= {ERR_PACK(0,EVP_F_EVP_PKEY_DECRYPT,0), "EVP_PKEY_decrypt"}, {ERR_PACK(0,EVP_F_EVP_PKEY_ENCRYPT,0), "EVP_PKEY_encrypt"}, {ERR_PACK(0,EVP_F_EVP_PKEY_NEW,0), "EVP_PKEY_new"}, -{ERR_PACK(0,EVP_F_EVP_PKEY_RGET_DH,0), "EVP_PKEY_rget_DH"}, -{ERR_PACK(0,EVP_F_EVP_PKEY_RGET_DSA,0), "EVP_PKEY_rget_DSA"}, -{ERR_PACK(0,EVP_F_EVP_PKEY_RGET_RSA,0), "EVP_PKEY_rget_RSA"}, +{ERR_PACK(0,EVP_F_EVP_PKEY_GET1_DH,0), "EVP_PKEY_get1_DH"}, +{ERR_PACK(0,EVP_F_EVP_PKEY_GET1_DSA,0), "EVP_PKEY_get1_DSA"}, +{ERR_PACK(0,EVP_F_EVP_PKEY_GET1_RSA,0), "EVP_PKEY_get1_RSA"}, {ERR_PACK(0,EVP_F_EVP_SIGNFINAL,0), "EVP_SignFinal"}, {ERR_PACK(0,EVP_F_EVP_VERIFYFINAL,0), "EVP_VerifyFinal"}, {ERR_PACK(0,EVP_F_PKCS5_PBE_KEYIVGEN,0), "PKCS5_PBE_keyivgen"}, diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c index ba95137a20..4cb387f8de 100644 --- a/crypto/evp/p_lib.c +++ b/crypto/evp/p_lib.c @@ -206,17 +206,17 @@ int EVP_PKEY_assign(EVP_PKEY *pkey, int type, char *key) } #ifndef NO_RSA -int EVP_PKEY_rset_RSA(EVP_PKEY *pkey, RSA *key) +int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, RSA *key) { int ret = EVP_PKEY_assign_RSA(pkey, key); if(ret) CRYPTO_add(&key->references, 1, CRYPTO_LOCK_RSA); return ret; } -RSA *EVP_PKEY_rget_RSA(EVP_PKEY *pkey) +RSA *EVP_PKEY_get1_RSA(EVP_PKEY *pkey) { if(pkey->type != EVP_PKEY_RSA) { - EVPerr(EVP_F_EVP_PKEY_RGET_RSA, EVP_R_EXPECTING_AN_RSA_KEY); + EVPerr(EVP_F_EVP_PKEY_GET1_RSA, EVP_R_EXPECTING_AN_RSA_KEY); return NULL; } CRYPTO_add(&pkey->pkey.rsa->references, 1, CRYPTO_LOCK_RSA); @@ -225,17 +225,17 @@ RSA *EVP_PKEY_rget_RSA(EVP_PKEY *pkey) #endif #ifndef NO_DSA -int EVP_PKEY_rset_DSA(EVP_PKEY *pkey, DSA *key) +int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, DSA *key) { int ret = EVP_PKEY_assign_DSA(pkey, key); if(ret) CRYPTO_add(&key->references, 1, CRYPTO_LOCK_DSA); return ret; } -DSA *EVP_PKEY_rget_DSA(EVP_PKEY *pkey) +DSA *EVP_PKEY_get1_DSA(EVP_PKEY *pkey) { if(pkey->type != EVP_PKEY_DSA) { - EVPerr(EVP_F_EVP_PKEY_RGET_DSA, EVP_R_EXPECTING_A_DSA_KEY); + EVPerr(EVP_F_EVP_PKEY_GET1_DSA, EVP_R_EXPECTING_A_DSA_KEY); return NULL; } CRYPTO_add(&pkey->pkey.dsa->references, 1, CRYPTO_LOCK_DSA); @@ -245,17 +245,17 @@ DSA *EVP_PKEY_rget_DSA(EVP_PKEY *pkey) #ifndef NO_DH -int EVP_PKEY_rset_DH(EVP_PKEY *pkey, DH *key) +int EVP_PKEY_set1_DH(EVP_PKEY *pkey, DH *key) { int ret = EVP_PKEY_assign_DH(pkey, key); if(ret) CRYPTO_add(&key->references, 1, CRYPTO_LOCK_DH); return ret; } -DH *EVP_PKEY_rget_DH(EVP_PKEY *pkey) +DH *EVP_PKEY_get1_DH(EVP_PKEY *pkey) { if(pkey->type != EVP_PKEY_DH) { - EVPerr(EVP_F_EVP_PKEY_RGET_DH, EVP_R_EXPECTING_A_DH_KEY); + EVPerr(EVP_F_EVP_PKEY_GET1_DH, EVP_R_EXPECTING_A_DH_KEY); return NULL; } CRYPTO_add(&pkey->pkey.dh->references, 1, CRYPTO_LOCK_DH); diff --git a/crypto/pem/pem_all.c b/crypto/pem/pem_all.c index f56788f6fd..dc9c35b4b4 100644 --- a/crypto/pem/pem_all.c +++ b/crypto/pem/pem_all.c @@ -105,7 +105,7 @@ static RSA *pkey_get_rsa(EVP_PKEY *key, RSA **rsa) { RSA *rtmp; if(!key) return NULL; - rtmp = EVP_PKEY_rget_RSA(key); + rtmp = EVP_PKEY_get1_RSA(key); EVP_PKEY_free(key); if(!rtmp) return NULL; if(rsa) { @@ -147,7 +147,7 @@ static DSA *pkey_get_dsa(EVP_PKEY *key, DSA **dsa) { DSA *dtmp; if(!key) return NULL; - dtmp = EVP_PKEY_rget_DSA(key); + dtmp = EVP_PKEY_get1_DSA(key); EVP_PKEY_free(key); if(!dtmp) return NULL; if(dsa) { diff --git a/crypto/pkcs7/pk7_smime.c b/crypto/pkcs7/pk7_smime.c index 058efcca2b..17e51941c7 100644 --- a/crypto/pkcs7/pk7_smime.c +++ b/crypto/pkcs7/pk7_smime.c @@ -184,7 +184,7 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, } - signers = PKCS7_iget_signers(p7, certs, flags); + signers = PKCS7_get0_signers(p7, certs, flags); if(!signers) return 0; @@ -264,7 +264,7 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, return 0; } -STACK_OF(X509) *PKCS7_iget_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags) +STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags) { STACK_OF(X509) *signers; STACK_OF(PKCS7_SIGNER_INFO) *sinfos; @@ -274,16 +274,16 @@ STACK_OF(X509) *PKCS7_iget_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags) int i; if(!p7) { - PKCS7err(PKCS7_F_PKCS7_IGET_SIGNERS,PKCS7_R_INVALID_NULL_POINTER); + PKCS7err(PKCS7_F_PKCS7_GET0_SIGNERS,PKCS7_R_INVALID_NULL_POINTER); return NULL; } if(!PKCS7_type_is_signed(p7)) { - PKCS7err(PKCS7_F_PKCS7_IGET_SIGNERS,PKCS7_R_WRONG_CONTENT_TYPE); + PKCS7err(PKCS7_F_PKCS7_GET0_SIGNERS,PKCS7_R_WRONG_CONTENT_TYPE); return NULL; } if(!(signers = sk_X509_new(NULL))) { - PKCS7err(PKCS7_F_PKCS7_IGET_SIGNERS,ERR_R_MALLOC_FAILURE); + PKCS7err(PKCS7_F_PKCS7_GET0_SIGNERS,ERR_R_MALLOC_FAILURE); return NULL; } @@ -292,7 +292,7 @@ STACK_OF(X509) *PKCS7_iget_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags) sinfos = PKCS7_get_signer_info(p7); if(sk_PKCS7_SIGNER_INFO_num(sinfos) <= 0) { - PKCS7err(PKCS7_F_PKCS7_IGET_SIGNERS,PKCS7_R_NO_SIGNERS); + PKCS7err(PKCS7_F_PKCS7_GET0_SIGNERS,PKCS7_R_NO_SIGNERS); return 0; } @@ -309,7 +309,7 @@ STACK_OF(X509) *PKCS7_iget_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags) X509_find_by_issuer_and_serial (p7->d.sign->cert, ias->issuer, ias->serial); if (!signer) { - PKCS7err(PKCS7_F_PKCS7_IGET_SIGNERS,PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND); + PKCS7err(PKCS7_F_PKCS7_GET0_SIGNERS,PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND); sk_X509_free(signers); return 0; } diff --git a/crypto/pkcs7/pkcs7.h b/crypto/pkcs7/pkcs7.h index d9047a21cf..3ec725d226 100644 --- a/crypto/pkcs7/pkcs7.h +++ b/crypto/pkcs7/pkcs7.h @@ -397,7 +397,7 @@ PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, BIO *data, int flags); int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, BIO *indata, BIO *out, int flags); -STACK_OF(X509) *PKCS7_iget_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags); +STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags); PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, EVP_CIPHER *cipher, int flags); int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags); @@ -433,7 +433,7 @@ int SMIME_text(BIO *in, BIO *out); #define PKCS7_F_PKCS7_DATAVERIFY 107 #define PKCS7_F_PKCS7_DECRYPT 114 #define PKCS7_F_PKCS7_ENCRYPT 115 -#define PKCS7_F_PKCS7_IGET_SIGNERS 124 +#define PKCS7_F_PKCS7_GET0_SIGNERS 124 #define PKCS7_F_PKCS7_SET_CIPHER 108 #define PKCS7_F_PKCS7_SET_CONTENT 109 #define PKCS7_F_PKCS7_SET_TYPE 110 diff --git a/crypto/pkcs7/pkcs7err.c b/crypto/pkcs7/pkcs7err.c index f3fbf0b263..813a8af9ed 100644 --- a/crypto/pkcs7/pkcs7err.c +++ b/crypto/pkcs7/pkcs7err.c @@ -79,7 +79,7 @@ static ERR_STRING_DATA PKCS7_str_functs[]= {ERR_PACK(0,PKCS7_F_PKCS7_DATAVERIFY,0), "PKCS7_dataVerify"}, {ERR_PACK(0,PKCS7_F_PKCS7_DECRYPT,0), "PKCS7_decrypt"}, {ERR_PACK(0,PKCS7_F_PKCS7_ENCRYPT,0), "PKCS7_encrypt"}, -{ERR_PACK(0,PKCS7_F_PKCS7_IGET_SIGNERS,0), "PKCS7_iget_signers"}, +{ERR_PACK(0,PKCS7_F_PKCS7_GET0_SIGNERS,0), "PKCS7_get0_signers"}, {ERR_PACK(0,PKCS7_F_PKCS7_SET_CIPHER,0), "PKCS7_set_cipher"}, {ERR_PACK(0,PKCS7_F_PKCS7_SET_CONTENT,0), "PKCS7_set_content"}, {ERR_PACK(0,PKCS7_F_PKCS7_SET_TYPE,0), "PKCS7_set_type"}, diff --git a/crypto/x509/x509.h b/crypto/x509/x509.h index 69a2e35ea9..bd602ce8b1 100644 --- a/crypto/x509/x509.h +++ b/crypto/x509/x509.h @@ -825,8 +825,8 @@ X509_CERT_AUX * d2i_X509_CERT_AUX(X509_CERT_AUX **a,unsigned char **pp, int X509_alias_rset(X509 *x, unsigned char *name, int len); unsigned char * X509_alias_iget(X509 *x, int *len); int (*X509_TRUST_set_default(int (*trust)(int , X509 *, int)))(int, X509 *, int); -int X509_radd_trust_object(X509 *x, ASN1_OBJECT *obj); -int X509_radd_reject_object(X509 *x, ASN1_OBJECT *obj); +int X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj); +int X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj); void X509_trust_clear(X509 *x); void X509_reject_clear(X509 *x); @@ -916,14 +916,14 @@ int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, ASN1_OBJECT *obj, int lastpos); X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc); X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc); -int X509_REQ_radd_attr(X509_REQ *req, X509_ATTRIBUTE *attr); -int X509_REQ_radd_attr_by_OBJ(X509_REQ *req, +int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr); +int X509_REQ_add1_attr_by_OBJ(X509_REQ *req, ASN1_OBJECT *obj, int type, unsigned char *bytes, int len); -int X509_REQ_radd_attr_by_NID(X509_REQ *req, +int X509_REQ_add1_attr_by_NID(X509_REQ *req, int nid, int type, unsigned char *bytes, int len); -int X509_REQ_radd_attr_by_txt(X509_REQ *req, +int X509_REQ_add1_attr_by_txt(X509_REQ *req, char *attrname, int type, unsigned char *bytes, int len); @@ -1050,15 +1050,15 @@ int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, ASN1_OBJECT *obj, int lastpos); X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc); X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc); -STACK_OF(X509_ATTRIBUTE) *X509at_radd_attr(STACK_OF(X509_ATTRIBUTE) **x, +STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, X509_ATTRIBUTE *attr); -STACK_OF(X509_ATTRIBUTE) *X509at_radd_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x, +STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x, ASN1_OBJECT *obj, int type, unsigned char *bytes, int len); -STACK_OF(X509_ATTRIBUTE) *X509at_radd_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x, +STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x, int nid, int type, unsigned char *bytes, int len); -STACK_OF(X509_ATTRIBUTE) *X509at_radd_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, +STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, char *attrname, int type, unsigned char *bytes, int len); X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, @@ -1067,13 +1067,13 @@ X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, ASN1_OBJECT *obj, int atrtype, void *data, int len); X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr, char *atrname, int type, unsigned char *bytes, int len); -int X509_ATTRIBUTE_rset_object(X509_ATTRIBUTE *attr, ASN1_OBJECT *obj); -int X509_ATTRIBUTE_rset_data(X509_ATTRIBUTE *attr, int attrtype, void *data, int len); -void *X509_ATTRIBUTE_iget_data(X509_ATTRIBUTE *attr, int idx, +int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, ASN1_OBJECT *obj); +int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, void *data, int len); +void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, int atrtype, void *data); int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr); -ASN1_OBJECT *X509_ATTRIBUTE_iget_object(X509_ATTRIBUTE *attr); -ASN1_TYPE *X509_ATTRIBUTE_iget_type(X509_ATTRIBUTE *attr, int idx); +ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr); +ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx); int X509_verify_cert(X509_STORE_CTX *ctx); @@ -1121,7 +1121,7 @@ int X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int), char *name, int arg1, void *arg2); void X509_TRUST_cleanup(void); int X509_TRUST_get_flags(X509_TRUST *xp); -char *X509_TRUST_iget_name(X509_TRUST *xp); +char *X509_TRUST_get0_name(X509_TRUST *xp); int X509_TRUST_get_trust(X509_TRUST *xp); /* BEGIN ERROR CODES */ @@ -1143,8 +1143,8 @@ int X509_TRUST_get_trust(X509_TRUST *xp); #define X509_F_X509_ATTRIBUTE_CREATE_BY_NID 136 #define X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ 137 #define X509_F_X509_ATTRIBUTE_CREATE_BY_TXT 140 -#define X509_F_X509_ATTRIBUTE_IGET_DATA 139 -#define X509_F_X509_ATTRIBUTE_RSET_DATA 138 +#define X509_F_X509_ATTRIBUTE_GET0_DATA 139 +#define X509_F_X509_ATTRIBUTE_SET1_DATA 138 #define X509_F_X509_CHECK_PRIVATE_KEY 128 #define X509_F_X509_EXTENSION_CREATE_BY_NID 108 #define X509_F_X509_EXTENSION_CREATE_BY_OBJ 109 diff --git a/crypto/x509/x509_att.c b/crypto/x509/x509_att.c index da76f9cd4d..caafde658f 100644 --- a/crypto/x509/x509_att.c +++ b/crypto/x509/x509_att.c @@ -119,7 +119,7 @@ X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc) return(ret); } -STACK_OF(X509_ATTRIBUTE) *X509at_radd_attr(STACK_OF(X509_ATTRIBUTE) **x, +STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, X509_ATTRIBUTE *attr) { X509_ATTRIBUTE *new_attr=NULL; @@ -148,7 +148,7 @@ err2: return(NULL); } -STACK_OF(X509_ATTRIBUTE) *X509at_radd_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x, +STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x, ASN1_OBJECT *obj, int type, unsigned char *bytes, int len) { @@ -156,12 +156,12 @@ STACK_OF(X509_ATTRIBUTE) *X509at_radd_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x, STACK_OF(X509_ATTRIBUTE) *ret; attr = X509_ATTRIBUTE_create_by_OBJ(NULL, obj, type, bytes, len); if(!attr) return 0; - ret = X509at_radd_attr(x, attr); + ret = X509at_add1_attr(x, attr); X509_ATTRIBUTE_free(attr); return ret; } -STACK_OF(X509_ATTRIBUTE) *X509at_radd_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x, +STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x, int nid, int type, unsigned char *bytes, int len) { @@ -169,12 +169,12 @@ STACK_OF(X509_ATTRIBUTE) *X509at_radd_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x, STACK_OF(X509_ATTRIBUTE) *ret; attr = X509_ATTRIBUTE_create_by_NID(NULL, nid, type, bytes, len); if(!attr) return 0; - ret = X509at_radd_attr(x, attr); + ret = X509at_add1_attr(x, attr); X509_ATTRIBUTE_free(attr); return ret; } -STACK_OF(X509_ATTRIBUTE) *X509at_radd_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, +STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, char *attrname, int type, unsigned char *bytes, int len) { @@ -182,7 +182,7 @@ STACK_OF(X509_ATTRIBUTE) *X509at_radd_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, STACK_OF(X509_ATTRIBUTE) *ret; attr = X509_ATTRIBUTE_create_by_txt(NULL, attrname, type, bytes, len); if(!attr) return 0; - ret = X509at_radd_attr(x, attr); + ret = X509at_add1_attr(x, attr); X509_ATTRIBUTE_free(attr); return ret; } @@ -220,9 +220,9 @@ X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, else ret= *attr; - if (!X509_ATTRIBUTE_rset_object(ret,obj)) + if (!X509_ATTRIBUTE_set1_object(ret,obj)) goto err; - if (!X509_ATTRIBUTE_rset_data(ret,atrtype,data,len)) + if (!X509_ATTRIBUTE_set1_data(ret,atrtype,data,len)) goto err; if ((attr != NULL) && (*attr == NULL)) *attr=ret; @@ -252,7 +252,7 @@ X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr, return nattr; } -int X509_ATTRIBUTE_rset_object(X509_ATTRIBUTE *attr, ASN1_OBJECT *obj) +int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, ASN1_OBJECT *obj) { if ((attr == NULL) || (obj == NULL)) return(0); @@ -261,7 +261,7 @@ int X509_ATTRIBUTE_rset_object(X509_ATTRIBUTE *attr, ASN1_OBJECT *obj) return(1); } -int X509_ATTRIBUTE_rset_data(X509_ATTRIBUTE *attr, int attrtype, void *data, int len) +int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, void *data, int len) { ASN1_TYPE *ttmp; ASN1_STRING *stmp; @@ -271,7 +271,7 @@ int X509_ATTRIBUTE_rset_data(X509_ATTRIBUTE *attr, int attrtype, void *data, int stmp = ASN1_STRING_set_by_NID(NULL, data, len, attrtype, OBJ_obj2nid(attr->object)); if(!stmp) { - X509err(X509_F_X509_ATTRIBUTE_RSET_DATA, ERR_R_ASN1_LIB); + X509err(X509_F_X509_ATTRIBUTE_SET1_DATA, ERR_R_ASN1_LIB); return 0; } atype = stmp->type; @@ -287,7 +287,7 @@ int X509_ATTRIBUTE_rset_data(X509_ATTRIBUTE *attr, int attrtype, void *data, int ASN1_TYPE_set(ttmp, atype, stmp); return 1; err: - X509err(X509_F_X509_ATTRIBUTE_RSET_DATA, ERR_R_MALLOC_FAILURE); + X509err(X509_F_X509_ATTRIBUTE_SET1_DATA, ERR_R_MALLOC_FAILURE); return 0; } @@ -298,26 +298,26 @@ int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr) return 0; } -ASN1_OBJECT *X509_ATTRIBUTE_iget_object(X509_ATTRIBUTE *attr) +ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr) { if (attr == NULL) return(NULL); return(attr->object); } -void *X509_ATTRIBUTE_iget_data(X509_ATTRIBUTE *attr, int idx, +void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, int atrtype, void *data) { ASN1_TYPE *ttmp; - ttmp = X509_ATTRIBUTE_iget_type(attr, idx); + ttmp = X509_ATTRIBUTE_get0_type(attr, idx); if(!ttmp) return NULL; if(atrtype != ASN1_TYPE_get(ttmp)){ - X509err(X509_F_X509_ATTRIBUTE_IGET_DATA, X509_R_WRONG_TYPE); + X509err(X509_F_X509_ATTRIBUTE_GET0_DATA, X509_R_WRONG_TYPE); return NULL; } return ttmp->value.ptr; } -ASN1_TYPE *X509_ATTRIBUTE_iget_type(X509_ATTRIBUTE *attr, int idx) +ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx) { if (attr == NULL) return(NULL); if(idx >= X509_ATTRIBUTE_count(attr)) return NULL; diff --git a/crypto/x509/x509_err.c b/crypto/x509/x509_err.c index a9a81167a7..fdedbdac34 100644 --- a/crypto/x509/x509_err.c +++ b/crypto/x509/x509_err.c @@ -76,8 +76,8 @@ static ERR_STRING_DATA X509_str_functs[]= {ERR_PACK(0,X509_F_X509_ATTRIBUTE_CREATE_BY_NID,0), "X509_ATTRIBUTE_create_by_NID"}, {ERR_PACK(0,X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ,0), "X509_ATTRIBUTE_create_by_OBJ"}, {ERR_PACK(0,X509_F_X509_ATTRIBUTE_CREATE_BY_TXT,0), "X509_ATTRIBUTE_create_by_txt"}, -{ERR_PACK(0,X509_F_X509_ATTRIBUTE_IGET_DATA,0), "X509_ATTRIBUTE_iget_data"}, -{ERR_PACK(0,X509_F_X509_ATTRIBUTE_RSET_DATA,0), "X509_ATTRIBUTE_rset_data"}, +{ERR_PACK(0,X509_F_X509_ATTRIBUTE_GET0_DATA,0), "X509_ATTRIBUTE_get0_data"}, +{ERR_PACK(0,X509_F_X509_ATTRIBUTE_SET1_DATA,0), "X509_ATTRIBUTE_set1_data"}, {ERR_PACK(0,X509_F_X509_CHECK_PRIVATE_KEY,0), "X509_check_private_key"}, {ERR_PACK(0,X509_F_X509_EXTENSION_CREATE_BY_NID,0), "X509_EXTENSION_create_by_NID"}, {ERR_PACK(0,X509_F_X509_EXTENSION_CREATE_BY_OBJ,0), "X509_EXTENSION_create_by_OBJ"}, diff --git a/crypto/x509/x509_req.c b/crypto/x509/x509_req.c index 68b8c2d76f..baef8790eb 100644 --- a/crypto/x509/x509_req.c +++ b/crypto/x509/x509_req.c @@ -244,35 +244,35 @@ X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc) return X509at_delete_attr(req->req_info->attributes, loc); } -int X509_REQ_radd_attr(X509_REQ *req, X509_ATTRIBUTE *attr) +int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr) { - if(X509at_radd_attr(&req->req_info->attributes, attr)) return 1; + if(X509at_add1_attr(&req->req_info->attributes, attr)) return 1; return 0; } -int X509_REQ_radd_attr_by_OBJ(X509_REQ *req, +int X509_REQ_add1_attr_by_OBJ(X509_REQ *req, ASN1_OBJECT *obj, int type, unsigned char *bytes, int len) { - if(X509at_radd_attr_by_OBJ(&req->req_info->attributes, obj, + if(X509at_add1_attr_by_OBJ(&req->req_info->attributes, obj, type, bytes, len)) return 1; return 0; } -int X509_REQ_radd_attr_by_NID(X509_REQ *req, +int X509_REQ_add1_attr_by_NID(X509_REQ *req, int nid, int type, unsigned char *bytes, int len) { - if(X509at_radd_attr_by_NID(&req->req_info->attributes, nid, + if(X509at_add1_attr_by_NID(&req->req_info->attributes, nid, type, bytes, len)) return 1; return 0; } -int X509_REQ_radd_attr_by_txt(X509_REQ *req, +int X509_REQ_add1_attr_by_txt(X509_REQ *req, char *attrname, int type, unsigned char *bytes, int len) { - if(X509at_radd_attr_by_txt(&req->req_info->attributes, attrname, + if(X509at_add1_attr_by_txt(&req->req_info->attributes, attrname, type, bytes, len)) return 1; return 0; } diff --git a/crypto/x509/x509_trs.c b/crypto/x509/x509_trs.c index c63920fd92..3f76cd89df 100644 --- a/crypto/x509/x509_trs.c +++ b/crypto/x509/x509_trs.c @@ -214,7 +214,7 @@ int X509_TRUST_get_flags(X509_TRUST *xp) return xp->flags; } -char *X509_TRUST_iget_name(X509_TRUST *xp) +char *X509_TRUST_get0_name(X509_TRUST *xp) { return xp->name; } diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c index ec25cf8d85..8de6cc97f3 100644 --- a/crypto/x509/x509_vfy.c +++ b/crypto/x509/x509_vfy.c @@ -717,7 +717,7 @@ STACK_OF(X509) *X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx) return(ctx->chain); } -STACK_OF(X509) *X509_STORE_CTX_rget_chain(X509_STORE_CTX *ctx) +STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx) { int i; X509 *x; diff --git a/crypto/x509/x509_vfy.h b/crypto/x509/x509_vfy.h index 7d064820f9..4637aecedf 100644 --- a/crypto/x509/x509_vfy.h +++ b/crypto/x509/x509_vfy.h @@ -347,7 +347,7 @@ void X509_STORE_CTX_set_error(X509_STORE_CTX *ctx,int s); int X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx); X509 * X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx); STACK_OF(X509) *X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx); -STACK_OF(X509) *X509_STORE_CTX_rget_chain(X509_STORE_CTX *ctx); +STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx); void X509_STORE_CTX_set_cert(X509_STORE_CTX *c,X509 *x); void X509_STORE_CTX_set_chain(X509_STORE_CTX *c,STACK_OF(X509) *sk); int X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose); |