Пакет Network Security Services и утилита oidcalc

, KMail, Kleopatra GnuPG, oid- - DER-, oidcalc NSS (Network Security Services), Linux, . .

, oid, 0 (), «1.2.643.2.2.36.0» (szOID_GostR3410_2001_CryptoPro_XchA_ParamSet). – . - , oid:

# oidcalc 1.2.643.2.2.36.0
0x2a, 0x85, 0x3, 0x2, 0x2, 0x24,
#

0x2a, 0x85, 0x3, 0x2, 0x2, 0x24, 0x0, — .

oid «1.2.643.3.6.0.1» ( , 1 ):

# oidcalc 1.2.643.3.6.0.1
0x2a, 0x85, 0x3, 0x3 0x3, 0x6, 0x1,
#

– . , oidcalc oid-. :

# oidcalc 1.2.643.3.6.1
0x2a, 0x85, 0x3, 0x3 0x3, 0x6, 0x1,
#

oid , :

# ./oid 1.2.643.2.2.36.0
06 07 2A 85 03 02 02 24 00
# ./oid 1.2.643.3.6.0.1
06 07 2A 85 03 03 06 00 01
#

oid ASN1-, , – , oid .

oidcalc.c :

       . . .
        memset(buf, 0, sizeof(buf));
        val = atoi(curstr);
        count = 0;
/* */
    if(curstr[0] != '0')
	
        while (val) {
            buf[count] = (val & 0x7f);
            val = val >> 7;
            count++;
        }
/*   */
    else
	buf[count++] = 0x00;
        . . . 

, , :

#oidcalc 1.2.643.2.2.36.0
0x2a, 0x85, 0x3, 0x2, 0x2, 0x24, 0x0,
#oidcalc 1.2.643.3.6.0.1
0x2a, 0x85, 0x3, 0x3, 0x6, 0x0, 0x1,
#

? . atoi, 0 () '0' ( ). .

NSS? , . , NSS /, PKCS#11, Mozilla, Chrome Google. , . , - . , , , / Linux .

Source: https://habr.com/ru/post/hi398783/


All Articles