VirtualBox

Changeset 85629 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Aug 6, 2020 12:56:34 AM (4 years ago)
Author:
vboxsync
Message:

IPRT: More SHA-3 work. bugref:9734

Location:
trunk/src/VBox/Runtime/common
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/asn1/oiddb.cfg

    r82968 r85629  
    54541.2.840.113549.1.1.13           = pkcs1-Sha512WithRsaEncryption
    55551.2.840.113549.1.1.14           = pkcs1-Sha224WithRsaEncryption
     561.2.840.113549.1.1.15           = pkcs1-Sha512-224WithRsaEncryption
     571.2.840.113549.1.1.16           = pkcs1-Sha512-256WithRsaEncryption
    56581.2.840.113549.1.7              = pkcs7
    57591.2.840.113549.1.7.1            = pkcs7-data
     
    2242262.16.840.1.101.3.4.1            = nist-aes-algorithms
    2252272.16.840.1.101.3.4.2            = nist-hash-algorithms
    226 2.16.840.1.101.3.4.2.1          = nist-Sha256
    227 2.16.840.1.101.3.4.2.2          = nist-Sha384
    228 2.16.840.1.101.3.4.2.3          = nist-Sha512
    229 2.16.840.1.101.3.4.2.4          = nist-Sha224
     2282.16.840.1.101.3.4.2.1          = nist-sha256
     2292.16.840.1.101.3.4.2.2          = nist-sha384
     2302.16.840.1.101.3.4.2.3          = nist-sha512
     2312.16.840.1.101.3.4.2.4          = nist-sha224
     2322.16.840.1.101.3.4.2.5          = nist-sha512-224
     2332.16.840.1.101.3.4.2.6          = nist-sha512-256
     2342.16.840.1.101.3.4.2.7          = nist-sha3-224
     2352.16.840.1.101.3.4.2.8          = nist-sha3-256
     2362.16.840.1.101.3.4.2.9          = nist-sha3-384
     2372.16.840.1.101.3.4.2.10         = nist-sha3-512
     2382.16.840.1.101.3.4.2.11         = nist-shake128
     2392.16.840.1.101.3.4.2.12         = nist-shake256
     2402.16.840.1.101.3.4.3            = nist-sigAlgs
     2412.16.840.1.101.3.4.3.1          = nist-dsa-with-sha224
     2422.16.840.1.101.3.4.3.2          = nist-dsa-with-sha256
     2432.16.840.1.101.3.4.3.3          = nist-dsa-with-sha384
     2442.16.840.1.101.3.4.3.4          = nist-dsa-with-sha512
     2452.16.840.1.101.3.4.3.5          = nist-id-dsa-with-sha224
     2462.16.840.1.101.3.4.3.6          = nist-id-dsa-with-sha256
     2472.16.840.1.101.3.4.3.7          = nist-id-dsa-with-sha384
     2482.16.840.1.101.3.4.3.8          = nist-id-dsa-with-sha512
     2492.16.840.1.101.3.4.3.9          = nist-id-ecdsa-with-sha3-224
     2502.16.840.1.101.3.4.3.10         = nist-id-ecdsa-with-sha3-256
     2512.16.840.1.101.3.4.3.11         = nist-id-ecdsa-with-sha3-384
     2522.16.840.1.101.3.4.3.12         = nist-id-ecdsa-with-sha3-512
     2532.16.840.1.101.3.4.3.13         = nist-id-rsassa-pkcs1-v1-5-with-sha3-224
     2542.16.840.1.101.3.4.3.14         = nist-id-rsassa-pkcs1-v1-5-with-sha3-256
     2552.16.840.1.101.3.4.3.15         = nist-id-rsassa-pkcs1-v1-5-with-sha3-384
     2562.16.840.1.101.3.4.3.16         = nist-id-rsassa-pkcs1-v1-5-with-sha3-512
    2302572.16.840.1.113730               = netscape
    2312582.16.840.1.113730.1.1           = netscape-cert-type
  • trunk/src/VBox/Runtime/common/crypto/pkix-signature-rsa.cpp

    r84251 r85629  
    112112    0x30,0x2d, 0x30,0x0d, 0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x04,   0x05,0x00,  0x04,0x1c
    113113};
    114 static const uint8_t g_abSha512T224[] =
     114static const uint8_t g_abSha512t224[] =
    115115{/* {          {          2.16.840.1.101.3.4.2.5 (SHA-512T224),                     NULL },     hash octet-string } */
    116116    0x30,0x2d, 0x30,0x0d, 0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x05,   0x05,0x00,  0x04,0x1c
    117117};
    118 static const uint8_t g_abSha512T256[] =
     118static const uint8_t g_abSha512t256[] =
    119119{/* {          {          2.16.840.1.101.3.4.2.6 (SHA-512T256),                     NULL },     hash octet-string } */
    120120    0x30,0x31, 0x30,0x0d, 0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x06,   0x05,0x00,  0x04,0x20
     121};
     122static const uint8_t g_abSha3t224[] =
     123{/* {          {          2.16.840.1.101.3.4.2.7 (SHA3-224),                        NULL },     hash octet-string } */
     124    0x30,0x31, 0x30,0x0d, 0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x07,   0x05,0x00,  0x04,0x1c
     125};
     126static const uint8_t g_abSha3t256[] =
     127{/* {          {          2.16.840.1.101.3.4.2.8 (SHA3-256),                        NULL },     hash octet-string } */
     128    0x30,0x31, 0x30,0x0d, 0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x08,   0x05,0x00,  0x04,0x20
     129};
     130static const uint8_t g_abSha3t384[] =
     131{/* {          {          2.16.840.1.101.3.4.2.9 (SHA3-384),                        NULL },     hash octet-string } */
     132    0x30,0x31, 0x30,0x0d, 0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x09,   0x05,0x00,  0x04,0x30
     133};
     134static const uint8_t g_abSha3t512[] =
     135{/* {          {          2.16.840.1.101.3.4.2.10 (SHA3-512),                       NULL },     hash octet-string } */
     136    0x30,0x31, 0x30,0x0d, 0x06,0x09,0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x02,0x0a,   0x05,0x00,  0x04,0x40
    121137};
    122138/** @} */
     
    138154    { RTDIGESTTYPE_SHA384,      g_abSha384,     sizeof(g_abSha384) },
    139155    { RTDIGESTTYPE_SHA224,      g_abSha224,     sizeof(g_abSha224) },
    140     { RTDIGESTTYPE_SHA512T224,  g_abSha512T224, sizeof(g_abSha512T224)},
    141     { RTDIGESTTYPE_SHA512T256,  g_abSha512T256, sizeof(g_abSha512T256)},
     156    { RTDIGESTTYPE_SHA512T224,  g_abSha512t224, sizeof(g_abSha512t224)},
     157    { RTDIGESTTYPE_SHA512T256,  g_abSha512t256, sizeof(g_abSha512t256)},
     158    { RTDIGESTTYPE_SHA3_224,    g_abSha3t224,   sizeof(g_abSha3t224) },
     159    { RTDIGESTTYPE_SHA3_256,    g_abSha3t256,   sizeof(g_abSha3t256) },
     160    { RTDIGESTTYPE_SHA3_384,    g_abSha3t384,   sizeof(g_abSha3t384) },
     161    { RTDIGESTTYPE_SHA3_512,    g_abSha3t512,   sizeof(g_abSha3t512) },
    142162};
    143163
  • trunk/src/VBox/Runtime/common/crypto/x509-core.cpp

    r84248 r85629  
    8383    if (!strcmp(pThis->Algorithm.szObjId, RTCRX509ALGORITHMIDENTIFIERID_SHA512T256))
    8484        return RTDIGESTTYPE_SHA512T256;
     85
     86    if (!strcmp(pThis->Algorithm.szObjId, RTCRX509ALGORITHMIDENTIFIERID_SHA3_224))
     87        return RTDIGESTTYPE_SHA3_224;
     88    if (!strcmp(pThis->Algorithm.szObjId, RTCRX509ALGORITHMIDENTIFIERID_SHA3_256))
     89        return RTDIGESTTYPE_SHA3_256;
     90    if (!strcmp(pThis->Algorithm.szObjId, RTCRX509ALGORITHMIDENTIFIERID_SHA3_384))
     91        return RTDIGESTTYPE_SHA3_384;
     92    if (!strcmp(pThis->Algorithm.szObjId, RTCRX509ALGORITHMIDENTIFIERID_SHA3_512))
     93        return RTDIGESTTYPE_SHA3_512;
    8594    return RTDIGESTTYPE_INVALID;
    8695}
     
    114123    if (!strcmp(pThis->Algorithm.szObjId, RTCRX509ALGORITHMIDENTIFIERID_SHA512T256))
    115124        return 256 / 8;
     125    if (!strcmp(pThis->Algorithm.szObjId, RTCRX509ALGORITHMIDENTIFIERID_SHA3_224))
     126        return 224 / 8;
     127    if (!strcmp(pThis->Algorithm.szObjId, RTCRX509ALGORITHMIDENTIFIERID_SHA3_256))
     128        return 256 / 8;
     129    if (!strcmp(pThis->Algorithm.szObjId, RTCRX509ALGORITHMIDENTIFIERID_SHA3_384))
     130        return 384 / 8;
     131    if (!strcmp(pThis->Algorithm.szObjId, RTCRX509ALGORITHMIDENTIFIERID_SHA3_512))
     132        return 512 / 8;
    116133    if (!strcmp(pThis->Algorithm.szObjId, RTCRX509ALGORITHMIDENTIFIERID_WHIRLPOOL))
    117134        return 512 / 8;
     
    180197    {
    181198        if (!strcmp(pszEncryptedDigestOid, RTCRX509ALGORITHMIDENTIFIERID_SHA512T256_WITH_RSA))
     199            return 0;
     200    }
     201    else if (!strcmp(pszDigestOid, RTCRX509ALGORITHMIDENTIFIERID_SHA3_224))
     202    {
     203        if (!strcmp(pszEncryptedDigestOid, RTCRX509ALGORITHMIDENTIFIERID_SHA3_224_WITH_RSA))
     204            return 0;
     205    }
     206    else if (!strcmp(pszDigestOid, RTCRX509ALGORITHMIDENTIFIERID_SHA3_256))
     207    {
     208        if (!strcmp(pszEncryptedDigestOid, RTCRX509ALGORITHMIDENTIFIERID_SHA3_256_WITH_RSA))
     209            return 0;
     210    }
     211    else if (!strcmp(pszDigestOid, RTCRX509ALGORITHMIDENTIFIERID_SHA3_384))
     212    {
     213        if (!strcmp(pszEncryptedDigestOid, RTCRX509ALGORITHMIDENTIFIERID_SHA3_384_WITH_RSA))
     214            return 0;
     215    }
     216    else if (!strcmp(pszDigestOid, RTCRX509ALGORITHMIDENTIFIERID_SHA3_512))
     217    {
     218        if (!strcmp(pszEncryptedDigestOid, RTCRX509ALGORITHMIDENTIFIERID_SHA3_512_WITH_RSA))
    182219            return 0;
    183220    }
     
    235272            || !strcmp(pszDigestOid, RTCRX509ALGORITHMIDENTIFIERID_SHA512T256_WITH_RSA))
    236273            return RTCRX509ALGORITHMIDENTIFIERID_SHA512T256_WITH_RSA;
     274        if (   !strcmp(pszDigestOid, RTCRX509ALGORITHMIDENTIFIERID_SHA3_224)
     275            || !strcmp(pszDigestOid, RTCRX509ALGORITHMIDENTIFIERID_SHA3_224_WITH_RSA))
     276            return RTCRX509ALGORITHMIDENTIFIERID_SHA3_224_WITH_RSA;
     277        if (   !strcmp(pszDigestOid, RTCRX509ALGORITHMIDENTIFIERID_SHA3_256)
     278            || !strcmp(pszDigestOid, RTCRX509ALGORITHMIDENTIFIERID_SHA3_256_WITH_RSA))
     279            return RTCRX509ALGORITHMIDENTIFIERID_SHA3_256_WITH_RSA;
     280        if (   !strcmp(pszDigestOid, RTCRX509ALGORITHMIDENTIFIERID_SHA3_384)
     281            || !strcmp(pszDigestOid, RTCRX509ALGORITHMIDENTIFIERID_SHA3_384_WITH_RSA))
     282            return RTCRX509ALGORITHMIDENTIFIERID_SHA3_384_WITH_RSA;
     283        if (   !strcmp(pszDigestOid, RTCRX509ALGORITHMIDENTIFIERID_SHA3_512)
     284            || !strcmp(pszDigestOid, RTCRX509ALGORITHMIDENTIFIERID_SHA3_512_WITH_RSA))
     285            return RTCRX509ALGORITHMIDENTIFIERID_SHA3_512_WITH_RSA;
    237286
    238287        /* if (!strcmp(pszDigestOid, RTCRX509ALGORITHMIDENTIFIERID_WHIRLPOOL))
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette