summaryrefslogtreecommitdiffstats
path: root/crypto/x509/x_req.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-03-10 22:50:22 +0100
committerRichard Levitte <levitte@openssl.org>2020-03-15 19:42:04 +0100
commit70a7dd6f96c28a1a3059bf3d175bfb24449202ae (patch)
treebed8cc22e8013b51568f4b8cf3e04bf55891bf6e /crypto/x509/x_req.c
parenta5ce329eb496eb7ae17d6198dac51c2ab417550e (diff)
X509: Rename X509_set0_sm2_id() and friends
- X509_set0_sm2_id() -> X509_set0_distinguishing_id() - X509_get0_sm2_id() -> X509_get0_distinguishing_id() - X509_REQ_set0_sm2_id -> X509_REQ_set0_distinguishing_id() - X509_REQ_get0_sm2_id -> X509_REQ_get0_distinguishing_id() The reason for this rename is that the SM2 ID isn't really a unique SM2 data item, but rather a re-use of the Distinguished that is defined in ISO/IEC 15946-3 as well as in FIPS 196, with no special attribution toward any algorithm in particular. Fixes #11293 Reviewed-by: Paul Yang <kaishen.yy@antfin.com> (Merged from https://github.com/openssl/openssl/pull/11302)
Diffstat (limited to 'crypto/x509/x_req.c')
-rw-r--r--crypto/x509/x_req.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/crypto/x509/x_req.c b/crypto/x509/x_req.c
index e9cc9ba41c..d8a89011e8 100644
--- a/crypto/x509/x_req.c
+++ b/crypto/x509/x_req.c
@@ -53,14 +53,14 @@ static int req_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
switch (operation) {
case ASN1_OP_D2I_PRE:
- ASN1_OCTET_STRING_free(ret->sm2_id);
+ ASN1_OCTET_STRING_free(ret->distinguishing_id);
/* fall thru */
case ASN1_OP_NEW_POST:
- ret->sm2_id = NULL;
+ ret->distinguishing_id = NULL;
break;
case ASN1_OP_FREE_POST:
- ASN1_OCTET_STRING_free(ret->sm2_id);
+ ASN1_OCTET_STRING_free(ret->distinguishing_id);
break;
}
#endif
@@ -90,15 +90,13 @@ IMPLEMENT_ASN1_FUNCTIONS(X509_REQ)
IMPLEMENT_ASN1_DUP_FUNCTION(X509_REQ)
-#ifndef OPENSSL_NO_SM2
-void X509_REQ_set0_sm2_id(X509_REQ *x, ASN1_OCTET_STRING *sm2_id)
+void X509_REQ_set0_distinguishing_id(X509_REQ *x, ASN1_OCTET_STRING *d_id)
{
- ASN1_OCTET_STRING_free(x->sm2_id);
- x->sm2_id = sm2_id;
+ ASN1_OCTET_STRING_free(x->distinguishing_id);
+ x->distinguishing_id = d_id;
}
-ASN1_OCTET_STRING *X509_REQ_get0_sm2_id(X509_REQ *x)
+ASN1_OCTET_STRING *X509_REQ_get0_distinguishing_id(X509_REQ *x)
{
- return x->sm2_id;
+ return x->distinguishing_id;
}
-#endif