Browse Source

obj: Add SM4 XTS OID

Add the following OID:

SM4-XTS: 1.2.156.10197.1.104.10

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19619)
Xu Yizhou 1 year ago
parent
commit
de8f6a3e29
5 changed files with 18 additions and 5 deletions
  1. 10 5
      crypto/objects/obj_dat.h
  2. 1 0
      crypto/objects/obj_mac.num
  3. 1 0
      crypto/objects/objects.txt
  4. 1 0
      fuzz/oids.txt
  5. 5 0
      include/openssl/obj_mac.h

+ 10 - 5
crypto/objects/obj_dat.h

@@ -10,7 +10,7 @@
  */
 
 /* Serialized OID's */
-static const unsigned char so[8356] = {
+static const unsigned char so[8364] = {
     0x2A,0x86,0x48,0x86,0xF7,0x0D,                 /* [    0] OBJ_rsadsi */
     0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,            /* [    6] OBJ_pkcs */
     0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x02,       /* [   13] OBJ_md2 */
@@ -1152,9 +1152,10 @@ static const unsigned char so[8356] = {
     0x60,0x86,0x48,0x01,0x86,0xF9,0x66,            /* [ 8325] OBJ_oracle */
     0x60,0x86,0x48,0x01,0x86,0xF9,0x66,0xAD,0xCA,0x7B,0x01,0x01,  /* [ 8332] OBJ_oracle_jdk_trustedkeyusage */
     0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x32,  /* [ 8344] OBJ_id_ct_signedTAL */
+    0x2A,0x81,0x1C,0xCF,0x55,0x01,0x68,0x0A,       /* [ 8355] OBJ_sm4_xts */
 };
 
-#define NUM_NID 1290
+#define NUM_NID 1291
 static const ASN1_OBJECT nid_objs[NUM_NID] = {
     {"UNDEF", "undefined", NID_undef},
     {"rsadsi", "RSA Data Security, Inc.", NID_rsadsi, 6, &so[0]},
@@ -2446,9 +2447,10 @@ static const ASN1_OBJECT nid_objs[NUM_NID] = {
     {"brainpoolP512r1tls13", "brainpoolP512r1tls13", NID_brainpoolP512r1tls13},
     {"brotli", "Brotli compression", NID_brotli},
     {"zstd", "Zstandard compression", NID_zstd},
+    {"SM4-XTS", "sm4-xts", NID_sm4_xts, 8, &so[8355]},
 };
 
-#define NUM_SN 1281
+#define NUM_SN 1282
 static const unsigned int sn_objs[NUM_SN] = {
      364,    /* "AD_DVCS" */
      419,    /* "AES-128-CBC" */
@@ -2735,6 +2737,7 @@ static const unsigned int sn_objs[NUM_SN] = {
     1133,    /* "SM4-ECB" */
     1248,    /* "SM4-GCM" */
     1135,    /* "SM4-OFB" */
+    1290,    /* "SM4-XTS" */
      188,    /* "SMIME" */
      167,    /* "SMIME-CAPS" */
      100,    /* "SN" */
@@ -3733,7 +3736,7 @@ static const unsigned int sn_objs[NUM_SN] = {
     1289,    /* "zstd" */
 };
 
-#define NUM_LN 1281
+#define NUM_LN 1282
 static const unsigned int ln_objs[NUM_LN] = {
      363,    /* "AD Time Stamping" */
      405,    /* "ANSI X9.62" */
@@ -4966,6 +4969,7 @@ static const unsigned int ln_objs[NUM_LN] = {
     1133,    /* "sm4-ecb" */
     1248,    /* "sm4-gcm" */
     1135,    /* "sm4-ofb" */
+    1290,    /* "sm4-xts" */
     1203,    /* "sshkdf" */
     1205,    /* "sskdf" */
       16,    /* "stateOrProvinceName" */
@@ -5018,7 +5022,7 @@ static const unsigned int ln_objs[NUM_LN] = {
      125,    /* "zlib compression" */
 };
 
-#define NUM_OBJ 1147
+#define NUM_OBJ 1148
 static const unsigned int obj_objs[NUM_OBJ] = {
        0,    /* OBJ_undef                        0 */
      181,    /* OBJ_iso                          1 */
@@ -5514,6 +5518,7 @@ static const unsigned int obj_objs[NUM_OBJ] = {
     1139,    /* OBJ_sm4_ctr                      1 2 156 10197 1 104 7 */
     1248,    /* OBJ_sm4_gcm                      1 2 156 10197 1 104 8 */
     1249,    /* OBJ_sm4_ccm                      1 2 156 10197 1 104 9 */
+    1290,    /* OBJ_sm4_xts                      1 2 156 10197 1 104 10 */
     1172,    /* OBJ_sm2                          1 2 156 10197 1 301 */
     1143,    /* OBJ_sm3                          1 2 156 10197 1 401 */
     1204,    /* OBJ_SM2_with_SM3                 1 2 156 10197 1 501 */

+ 1 - 0
crypto/objects/obj_mac.num

@@ -1287,3 +1287,4 @@ brainpoolP384r1tls13		1286
 brainpoolP512r1tls13		1287
 brotli		1288
 zstd		1289
+sm4_xts		1290

+ 1 - 0
crypto/objects/objects.txt

@@ -1611,6 +1611,7 @@ sm-scheme 104 6         : SM4-CFB8            : sm4-cfb8
 sm-scheme 104 7         : SM4-CTR             : sm4-ctr
 sm-scheme 104 8         : SM4-GCM             : sm4-gcm
 sm-scheme 104 9         : SM4-CCM             : sm4-ccm
+sm-scheme 104 10        : SM4-XTS             : sm4-xts
 
 # There is no OID that just denotes "HMAC" oddly enough...
 

+ 1 - 0
fuzz/oids.txt

@@ -1148,3 +1148,4 @@ OBJ_hmacWithSM3="\x2A\x81\x1C\xCF\x55\x01\x83\x11\x03\x01"
 OBJ_oracle="\x60\x86\x48\x01\x86\xF9\x66"
 OBJ_oracle_jdk_trustedkeyusage="\x60\x86\x48\x01\x86\xF9\x66\xAD\xCA\x7B\x01\x01"
 OBJ_id_ct_signedTAL="\x2A\x86\x48\x86\xF7\x0D\x01\x09\x10\x01\x32"
+OBJ_sm4_xts="\x2A\x81\x1C\xCF\x55\x01\x68\x0A"

+ 5 - 0
include/openssl/obj_mac.h

@@ -5094,6 +5094,11 @@
 #define NID_sm4_ccm             1249
 #define OBJ_sm4_ccm             OBJ_sm_scheme,104L,9L
 
+#define SN_sm4_xts              "SM4-XTS"
+#define LN_sm4_xts              "sm4-xts"
+#define NID_sm4_xts             1290
+#define OBJ_sm4_xts             OBJ_sm_scheme,104L,10L
+
 #define SN_hmac         "HMAC"
 #define LN_hmac         "hmac"
 #define NID_hmac                855