VirtualBox

Changeset 74295 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Sep 16, 2018 3:36:08 PM (6 years ago)
Author:
vboxsync
Message:

IPRT/crypto: Wrapped SSL, alleged RC4, and RSA key generation. Added methods for quering someRSA key components. Exposed big numbers, x509 and asn1 APIs as stable. bugref:9246

Location:
trunk/include/iprt
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/asn1.h

    r73662 r74295  
    10221022RTDECL(int) RTAsn1Time_CompareWithTimeSpec(PCRTASN1TIME pLeft, PCRTTIMESPEC pTsRight);
    10231023
     1024RTDECL(int) RTAsn1Time_InitEx(PRTASN1TIME pThis, uint32_t uTag, PCRTASN1ALLOCATORVTABLE pAllocator);
     1025
    10241026/** @name Predicate macros for determing the exact type of RTASN1TIME.
    10251027 * @{ */
     
    11511153                                         const char *pszErrorTag);
    11521154RTDECL(uint64_t) RTAsn1BitString_GetAsUInt64(PCRTASN1BITSTRING pThis);
     1155RTDECL(int) RTAsn1BitString_RefreshContent(PRTASN1BITSTRING pThis, uint32_t fFlags,
     1156                                           PCRTASN1ALLOCATORVTABLE pAllocator, PRTERRINFO pErrInfo);
     1157RTDECL(bool) RTAsn1BitString_AreContentBitsValid(PCRTASN1BITSTRING pThis, uint32_t fFlags);
    11531158
    11541159RTASN1_IMPL_GEN_SEQ_OF_TYPEDEFS_AND_PROTOS(RTASN1SEQOFBITSTRINGS, RTASN1BITSTRING, RTDECL, RTAsn1SeqOfBitStrings);
     
    11821187RTASN1TYPE_STANDARD_PROTOTYPES(RTASN1OCTETSTRING, RTDECL, RTAsn1OctetString, Asn1Core);
    11831188
    1184 RTDECL(int) RTAsn1OctetStringCompare(PCRTASN1OCTETSTRING pLeft, PCRTASN1OCTETSTRING pRight);
     1189RTDECL(bool) RTAsn1OctetString_AreContentBytesValid(PCRTASN1OCTETSTRING pThis, uint32_t fFlags);
     1190RTDECL(int) RTAsn1OctetString_RefreshContent(PRTASN1OCTETSTRING pThis, uint32_t fFlags,
     1191                                             PCRTASN1ALLOCATORVTABLE pAllocator, PRTERRINFO pErrInfo);
    11851192
    11861193RTASN1_IMPL_GEN_SEQ_OF_TYPEDEFS_AND_PROTOS(RTASN1SEQOFOCTETSTRINGS, RTASN1OCTETSTRING, RTDECL, RTAsn1SeqOfOctetStrings);
     
    12571264 */
    12581265RTDECL(int) RTAsn1String_CompareEx(PCRTASN1STRING pLeft, PCRTASN1STRING pRight, bool fTypeToo);
     1266RTDECL(int) RTAsn1String_CompareValues(PCRTASN1STRING pLeft, PCRTASN1STRING pRight);
    12591267
    12601268/**
     
    16921700                                              const char *pszErrorTag);
    16931701
     1702RTDECL(int) RTAsn1CursorInitSub(PRTASN1CURSOR pParent, uint32_t cb, PRTASN1CURSOR pChild, const char *pszErrorTag);
    16941703
    16951704/**
  • trunk/include/iprt/crypto/key.h

    r73749 r74295  
    6060
    6161
    62 RTDECL(int)             RTCrKeyCreateFromSubjectPublicKeyInfo(PRTCRKEY hKey, struct RTCRX509SUBJECTPUBLICKEYINFO const *pSrc,
     62RTDECL(int)             RTCrKeyCreateFromSubjectPublicKeyInfo(PRTCRKEY phKey, struct RTCRX509SUBJECTPUBLICKEYINFO const *pSrc,
    6363                                                              PRTERRINFO pErrInfo, const char *pszErrorTag);
    64 RTDECL(int)             RTCrKeyCreateFromPublicAlgorithmAndBits(PRTCRKEY hKey,  PCRTASN1OBJID pAlgorithm,
     64RTDECL(int)             RTCrKeyCreateFromPublicAlgorithmAndBits(PRTCRKEY phKey,  PCRTASN1OBJID pAlgorithm,
    6565                                                                PCRTASN1BITSTRING pPublicKey,
    6666                                                                PRTERRINFO pErrInfo, const char *pszErrorTag);
    67 RTDECL(int)             RTCrKeyCreateFromPemSection(PRTCRKEY hKey, uint32_t fFlags, struct RTCRPEMSECTION const *pSection,
     67RTDECL(int)             RTCrKeyCreateFromPemSection(PRTCRKEY phKey, uint32_t fFlags, struct RTCRPEMSECTION const *pSection,
    6868                                                    const char *pszPassword, PRTERRINFO pErrInfo, const char *pszErrorTag);
    69 RTDECL(int)             RTCrKeyCreateFromBuffer(PRTCRKEY hKey, uint32_t fFlags, void const *pvSrc, size_t cbSrc,
     69RTDECL(int)             RTCrKeyCreateFromBuffer(PRTCRKEY phKey, uint32_t fFlags, void const *pvSrc, size_t cbSrc,
    7070                                                const char *pszPassword, PRTERRINFO pErrInfo, const char *pszErrorTag);
    71 RTDECL(int)             RTCrKeyCreateFromFile(PRTCRKEY hKey, uint32_t fFlags, const char *pszFilename,
     71RTDECL(int)             RTCrKeyCreateFromFile(PRTCRKEY phKey, uint32_t fFlags, const char *pszFilename,
    7272                                              const char *pszPassword, PRTERRINFO pErrInfo);
    7373/** @todo add support for decrypting private keys.  */
     
    8181/** @} */
    8282
     83RTDECL(int)             RTCrKeyCreateNewRsa(PRTCRKEY phKey, uint32_t cBits, uint32_t uPubExp, uint32_t fFlags);
     84
     85
    8386RTDECL(uint32_t)        RTCrKeyRetain(RTCRKEY hKey);
    8487RTDECL(uint32_t)        RTCrKeyRelease(RTCRKEY hKey);
     
    8790RTDECL(bool)            RTCrKeyHasPublicPart(RTCRKEY hKey);
    8891RTDECL(uint32_t)        RTCrKeyGetBitCount(RTCRKEY hKey);
    89 
     92RTDECL(int)             RTCrKeyQueryRsaModulus(RTCRKEY hKey, PRTBIGNUM pModulus);
     93RTDECL(int)             RTCrKeyQueryRsaPrivateExponent(RTCRKEY hKey, PRTBIGNUM pPrivateExponent);
    9094
    9195/** Public key markers. */
  • trunk/include/iprt/err.h

    r74179 r74295  
    27862786/** The key was decrypted. */
    27872787#define VINF_CR_KEY_WAS_DECRYPTED                   (23814)
     2788/** Failed to generate RSA key. */
     2789#define VERR_CR_KEY_GEN_FAILED_RSA                  (-23815)
    27882790/** @} */
    27892791
  • trunk/include/iprt/mangling.h

    r74148 r74295  
    27682768# define RTAsn1CursorInitArrayAllocation                RT_MANGLER(RTAsn1CursorInitArrayAllocation)
    27692769# define RTAsn1CursorInitPrimary                        RT_MANGLER(RTAsn1CursorInitPrimary)
     2770# define RTAsn1CursorInitSub                            RT_MANGLER(RTAsn1CursorInitSub)
    27702771# define RTAsn1CursorInitSubFromCore                    RT_MANGLER(RTAsn1CursorInitSubFromCore)
    27712772# define RTAsn1CursorIsNextEx                           RT_MANGLER(RTAsn1CursorIsNextEx)
     
    27902791# define RTAsn1BitString_GetAsUInt64                    RT_MANGLER(RTAsn1BitString_GetAsUInt64)
    27912792# define RTAsn1BitString_Init                           RT_MANGLER(RTAsn1BitString_Init)
     2793# define RTAsn1BitString_AreContentBitsValid            RT_MANGLER(RTAsn1BitString_AreContentBitsValid)
     2794# define RTAsn1BitString_RefreshContent                 RT_MANGLER(RTAsn1BitString_RefreshContent)
    27922795# define RTAsn1SeqOfBitStrings_CheckSanity              RT_MANGLER(RTAsn1SeqOfBitStrings_CheckSanity)
    27932796# define RTAsn1SeqOfBitStrings_Clone                    RT_MANGLER(RTAsn1SeqOfBitStrings_Clone)
     
    29482951# define RTAsn1OctetString_Enum                         RT_MANGLER(RTAsn1OctetString_Enum)
    29492952# define RTAsn1OctetString_Init                         RT_MANGLER(RTAsn1OctetString_Init)
     2953# define RTAsn1OctetString_AreContentBytesValid         RT_MANGLER(RTAsn1OctetString_AreContentBytesValid)
     2954# define RTAsn1OctetString_RefreshContent               RT_MANGLER(RTAsn1OctetString_RefreshContent)
    29502955# define RTAsn1SeqOfOctetStrings_CheckSanity            RT_MANGLER(RTAsn1SeqOfOctetStrings_CheckSanity)
    29512956# define RTAsn1SeqOfOctetStrings_Clone                  RT_MANGLER(RTAsn1SeqOfOctetStrings_Clone)
     
    30153020# define RTAsn1String_Compare                           RT_MANGLER(RTAsn1String_Compare)
    30163021# define RTAsn1String_CompareEx                         RT_MANGLER(RTAsn1String_CompareEx)
     3022# define RTAsn1String_CompareValues                     RT_MANGLER(RTAsn1String_CompareValues)
    30173023# define RTAsn1String_CompareWithString                 RT_MANGLER(RTAsn1String_CompareWithString)
    30183024# define RTAsn1String_Delete                            RT_MANGLER(RTAsn1String_Delete)
     
    30863092# define RTAsn1Time_Enum                                RT_MANGLER(RTAsn1Time_Enum)
    30873093# define RTAsn1Time_Init                                RT_MANGLER(RTAsn1Time_Init)
     3094# define RTAsn1Time_InitEx                              RT_MANGLER(RTAsn1Time_InitEx)
    30883095# define RTAsn1UtcTime_CheckSanity                      RT_MANGLER(RTAsn1UtcTime_CheckSanity)
    30893096# define RTAsn1UtcTime_Clone                            RT_MANGLER(RTAsn1UtcTime_Clone)
     
    31393146# define RTCrKeyRelease                                 RT_MANGLER(RTCrKeyRelease)
    31403147# define RTCrKeyRetain                                  RT_MANGLER(RTCrKeyRetain)
     3148# define RTCrKeyQueryRsaModulus                         RT_MANGLER(RTCrKeyQueryRsaModulus)
     3149# define RTCrKeyQueryRsaPrivateExponent                 RT_MANGLER(RTCrKeyQueryRsaPrivateExponent)
     3150# define RTCrRc4                                        RT_MANGLER(RTCrRc4)
     3151# define RTCrRc4SetKey                                  RT_MANGLER(RTCrRc4SetKey)
    31413152# define RTCrRsaDigestInfo_DecodeAsn1                   RT_MANGLER(RTCrRsaDigestInfo_DecodeAsn1)
    31423153# define RTCrRsaOtherPrimeInfo_DecodeAsn1               RT_MANGLER(RTCrRsaOtherPrimeInfo_DecodeAsn1)
     
    33513362# define RTCrSpcSerializedPageHashes_CheckSanity        RT_MANGLER(RTCrSpcSerializedPageHashes_CheckSanity)
    33523363# define RTCrSpcString_CheckSanity                      RT_MANGLER(RTCrSpcString_CheckSanity)
     3364# define RTCrSslCreate                                  RT_MANGLER(RTCrSslCreate)
     3365# define RTCrSslCreateSessionForNativeSocket            RT_MANGLER(RTCrSslCreateSessionForNativeSocket)
     3366# define RTCrSslLoadTrustedRootCerts                    RT_MANGLER(RTCrSslLoadTrustedRootCerts)
     3367# define RTCrSslRelease                                 RT_MANGLER(RTCrSslRelease)
     3368# define RTCrSslRetain                                  RT_MANGLER(RTCrSslRetain)
     3369# define RTCrSslSessionAccept                           RT_MANGLER(RTCrSslSessionAccept)
     3370# define RTCrSslSessionConnect                          RT_MANGLER(RTCrSslSessionConnect)
     3371# define RTCrSslSessionGetCertIssuerNameAsString        RT_MANGLER(RTCrSslSessionGetCertIssuerNameAsString)
     3372# define RTCrSslSessionGetVersion                       RT_MANGLER(RTCrSslSessionGetVersion)
     3373# define RTCrSslSessionPending                          RT_MANGLER(RTCrSslSessionPending)
     3374# define RTCrSslSessionRead                             RT_MANGLER(RTCrSslSessionRead)
     3375# define RTCrSslSessionRelease                          RT_MANGLER(RTCrSslSessionRelease)
     3376# define RTCrSslSessionRetain                           RT_MANGLER(RTCrSslSessionRetain)
     3377# define RTCrSslSessionWrite                            RT_MANGLER(RTCrSslSessionWrite)
     3378# define RTCrSslSetCertificateFile                      RT_MANGLER(RTCrSslSetCertificateFile)
     3379# define RTCrSslSetNoPeerVerify                         RT_MANGLER(RTCrSslSetNoPeerVerify)
     3380# define RTCrSslSetPrivateKeyFile                       RT_MANGLER(RTCrSslSetPrivateKeyFile)
    33533381# define RTCrX509AlgorithmIdentifier_DecodeAsn1         RT_MANGLER(RTCrX509AlgorithmIdentifier_DecodeAsn1)
    33543382# define RTCrX509AlgorithmIdentifiers_DecodeAsn1        RT_MANGLER(RTCrX509AlgorithmIdentifiers_DecodeAsn1)
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