VirtualBox

Changeset 73705 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Aug 16, 2018 9:31:18 AM (6 years ago)
Author:
vboxsync
Message:

IPRT: Better fix for missing md4 failure; adding information status codes for indicating deprecated and compromised digests when used.

Location:
trunk/include/iprt
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/crypto/digest.h

    r69105 r73705  
    5757    /** The size of the state. */
    5858    uint32_t            cbState;
    59     /** Reserved. */
    60     uint32_t            uReserved;
     59    /** Flags, RTCRDIGESTDESC_F_XXX. */
     60    uint32_t            fFlags;
    6161
    6262    /**
     
    144144/** Pointer to const message digest details and vtable. */
    145145typedef RTCRDIGESTDESC const *PCRTCRDIGESTDESC;
     146
     147/** @name RTCRDIGESTDESC_F_XXX
     148 * @{ */
     149/** Digest is deprecated. */
     150#define RTCRDIGESTDESC_F_DEPRECATED             RT_BIT_32(0)
     151/** Digest is compromised. */
     152#define RTCRDIGESTDESC_F_COMPROMISED            RT_BIT_32(1)
     153/** Digest is severely compromised. */
     154#define RTCRDIGESTDESC_F_SERVERELY_COMPROMISED  RT_BIT_32(2)
     155/** @} */
    146156
    147157/**
     
    175185
    176186RTDECL(PCRTCRDIGESTDESC) RTCrDigestFindByType(RTDIGESTTYPE enmDigestType);
    177 RTDECL(int) RTCrDigestCreateByObjIdString(PRTCRDIGEST phDigest, const char *pszObjId);
    178 RTDECL(int) RTCrDigestCreateByObjId(PRTCRDIGEST phDigest, PCRTASN1OBJID pObjId);
    179 RTDECL(int) RTCrDigestCreateByType(PRTCRDIGEST phDigest, RTDIGESTTYPE enmDigestType);
    180 
    181 
    182 RTDECL(int) RTCrDigestCreate(PRTCRDIGEST phDigest, PCRTCRDIGESTDESC pDesc, void *pvOpaque);
    183 RTDECL(int) RTCrDigestClone(PRTCRDIGEST phDigest, RTCRDIGEST hSrc);
    184 RTDECL(int) RTCrDigestReset(RTCRDIGEST hDigest);
    185 RTDECL(uint32_t) RTCrDigestRetain(RTCRDIGEST hDigest);
    186 RTDECL(uint32_t) RTCrDigestRelease(RTCRDIGEST hDigest);
    187 RTDECL(int) RTCrDigestUpdate(RTCRDIGEST hDigest, void const *pvData, size_t cbData);
    188 RTDECL(int) RTCrDigestUpdateFromVfsFile(RTCRDIGEST hDigest, RTVFSFILE hVfsFile, bool fRewindFile);
    189 RTDECL(int) RTCrDigestFinal(RTCRDIGEST hDigest, void *pvHash, size_t cbHash);
    190 RTDECL(bool) RTCrDigestMatch(RTCRDIGEST hDigest, void const *pvHash, size_t cbHash);
     187RTDECL(int)             RTCrDigestCreateByObjIdString(PRTCRDIGEST phDigest, const char *pszObjId);
     188RTDECL(int)             RTCrDigestCreateByObjId(PRTCRDIGEST phDigest, PCRTASN1OBJID pObjId);
     189RTDECL(int)             RTCrDigestCreateByType(PRTCRDIGEST phDigest, RTDIGESTTYPE enmDigestType);
     190
     191
     192/**
     193 * @returns IPRT status code.
     194 * @retval  VINF_SUCCESS on success.
     195 * @retval  VINF_CR_DIGEST_DEPRECATED on success from a deprecated hash algorithm.
     196 * @retval  VINF_CR_DIGEST_COMPROMISED on success from a compromised hash algorithm.
     197 * @retval  VINF_CR_DIGEST_SEVERELY_COMPROMISED on success from a severely compromised hash algorithm.
     198 */
     199RTDECL(int)             RTCrDigestCreate(PRTCRDIGEST phDigest, PCRTCRDIGESTDESC pDesc, void *pvOpaque);
     200/**
     201 * @returns IPRT status code.
     202 * @retval  VINF_SUCCESS on success.
     203 * @retval  VINF_CR_DIGEST_DEPRECATED on success from a deprecated hash algorithm.
     204 * @retval  VINF_CR_DIGEST_COMPROMISED on success from a compromised hash algorithm.
     205 * @retval  VINF_CR_DIGEST_SEVERELY_COMPROMISED on success from a severely compromised hash algorithm.
     206 */
     207RTDECL(int)             RTCrDigestClone(PRTCRDIGEST phDigest, RTCRDIGEST hSrc);
     208RTDECL(int)             RTCrDigestReset(RTCRDIGEST hDigest);
     209RTDECL(uint32_t)        RTCrDigestRetain(RTCRDIGEST hDigest);
     210RTDECL(uint32_t)        RTCrDigestRelease(RTCRDIGEST hDigest);
     211RTDECL(int)             RTCrDigestUpdate(RTCRDIGEST hDigest, void const *pvData, size_t cbData);
     212RTDECL(int)             RTCrDigestUpdateFromVfsFile(RTCRDIGEST hDigest, RTVFSFILE hVfsFile, bool fRewindFile);
     213
     214/**
     215 * Finalizes the hash calculation, copying out the resulting hash value.
     216 *
     217 * This can be called more than once and will always return the same result.
     218 *
     219 * @returns IPRT status code.
     220 * @retval  VINF_SUCCESS on success.
     221 * @retval  VINF_CR_DIGEST_DEPRECATED on success from a deprecated hash algorithm.
     222 * @retval  VINF_CR_DIGEST_COMPROMISED on success from a compromised hash algorithm.
     223 * @retval  VINF_CR_DIGEST_SEVERELY_COMPROMISED on success from a severely compromised hash algorithm.
     224 * @retval  VINF_BUFFER_UNDERFLOW if the supplied buffer is too big.
     225 * @retval  VERR_BUFFER_OVERFLOW if the supplied buffer is too small.
     226 * @retval  VERR_INVALID_STATE if there is nothing to finalize.
     227 *
     228 * @param   hDigest     The digest handle.
     229 * @param   pvHash      Where to return the hash. Optional.
     230 * @param   cbHash      The hash size.  Optional.
     231 */
     232RTDECL(int)             RTCrDigestFinal(RTCRDIGEST hDigest, void *pvHash, size_t cbHash);
     233
     234RTDECL(bool)            RTCrDigestMatch(RTCRDIGEST hDigest, void const *pvHash, size_t cbHash);
    191235RTDECL(uint8_t const *) RTCrDigestGetHash(RTCRDIGEST hDigest);
    192 RTDECL(uint32_t) RTCrDigestGetHashSize(RTCRDIGEST hDigest);
    193 RTDECL(uint64_t) RTCrDigestGetConsumedSize(RTCRDIGEST hDigest);
    194 RTDECL(bool) RTCrDigestIsFinalized(RTCRDIGEST hDigest);
    195 RTDECL(RTDIGESTTYPE) RTCrDigestGetType(RTCRDIGEST hDigest);
    196 RTDECL(const char *) RTCrDigestGetAlgorithmOid(RTCRDIGEST hDigest);
     236RTDECL(uint32_t)        RTCrDigestGetHashSize(RTCRDIGEST hDigest);
     237RTDECL(uint64_t)        RTCrDigestGetConsumedSize(RTCRDIGEST hDigest);
     238RTDECL(bool)            RTCrDigestIsFinalized(RTCRDIGEST hDigest);
     239RTDECL(RTDIGESTTYPE)    RTCrDigestGetType(RTCRDIGEST hDigest);
     240RTDECL(const char *)    RTCrDigestGetAlgorithmOid(RTCRDIGEST hDigest);
     241
     242/**
     243 * Gets the flags for the algorithm.
     244 *
     245 * @returns RTCRDIGESTDESC_F_XXX, UINT32_MAX on invalid handle.
     246 * @param   hDigest     The digest handle.
     247 */
     248RTDECL(uint32_t)        RTCrDigestGetFlags(RTCRDIGEST hDigest);
    197249
    198250
  • trunk/include/iprt/crypto/pkix.h

    r73677 r73705  
    216216     * @returns IPRT status code.
    217217     * @retval  VINF_SUCCESS if the signature checked out correctly.
     218     * @retval  VINF_CR_DIGEST_DEPRECATED if the signature checked out correctly
     219     *          but the hash algorithm is deprecated.
     220     * @retval  VINF_CR_DIGEST_COMPROMISED if the signature checked out correctly
     221     *          but the hash algorithm is compromised.
     222     * @retval  VINF_CR_DIGEST_SEVERELY_COMPROMISED if the signature checked out
     223     *          correctly but the hash algorithm is severely compromised.
    218224     * @retval  VERR_PKIX_KEY wrong key or some other key issue.
    219225     *
     
    234240     * @returns IPRT status code.
    235241     * @retval  VINF_SUCCESS on success.
     242     * @retval  VINF_CR_DIGEST_DEPRECATED on success but the hash algorithm is deprecated.
     243     * @retval  VINF_CR_DIGEST_COMPROMISED on success but the hash algorithm is compromised.
     244     * @retval  VINF_CR_DIGEST_SEVERELY_COMPROMISED on success but the hash algorithm
     245     *          is severely compromised.
    236246     * @retval  VERR_PKIX_KEY wrong key or some other key issue.
    237247     * @retval  VERR_BUFFER_OVERFLOW if the signature buffer is too small, the
     
    257267typedef RTCRPKIXSIGNATUREDESC const *PCRTCRPKIXSIGNATUREDESC;
    258268
    259 
     269/**
     270 * Locates a signature schema provider descriptor by object ID string.
     271 * @returns Pointer to descriptor on success, NULL on if not found.
     272 * @param   pObjId      The ID of the signature to search for.
     273 * @param   ppvOpaque   Where to store an opaque schema parameter. Optional.
     274 */
    260275PCRTCRPKIXSIGNATUREDESC RTCrPkixSignatureFindByObjIdString(const char *pszObjId, void *ppvOpaque);
     276
     277/**
     278 * Locates a signature schema provider descriptor by ASN.1 object ID.
     279 * @returns Pointer to descriptor on success, NULL on if not found.
     280 * @param   pObjId      The ID of the signature to search for.
     281 * @param   ppvOpaque   Where to store an opaque schema parameter. Optional.
     282 */
    261283PCRTCRPKIXSIGNATUREDESC RTCrPkixSignatureFindByObjId(PCRTASN1OBJID pObjId, void **ppvOpaque);
     284
     285/**
     286 * Create a signature schema provier instance.
     287 *
     288 * @returns IPRT status code.
     289 * @param   phSignature Where to return the handle to the created instance.
     290 * @param   pDesc       The signature schema provider descriptor.  Use
     291 *                      RTCrPkixSignatureFindByObjIdString() or RTCrPkixSignatureFindByObjId()
     292 *                      to get this.
     293 * @param   pvOpaque    The opaque schema parameter returned by the find functions.
     294 * @param   fSigning    Set if the intention is to sign stuff, clear if verification only.
     295 * @param   hKey        The key handle.  A referenced will be retained.
     296 * @param   pParams     Algorithm/key parameters, optional.
     297 */
     298RTDECL(int) RTCrPkixSignatureCreate(PRTCRPKIXSIGNATURE phSignature, PCRTCRPKIXSIGNATUREDESC pDesc, void *pvOpaque,
     299                                    bool fSigning, RTCRKEY hKey, PCRTASN1DYNTYPE pParams);
     300/** Convenience wrapper function for RTCrPkixSignatureCreate(). */
    262301RTDECL(int) RTCrPkixSignatureCreateByObjIdString(PRTCRPKIXSIGNATURE phSignature, const char *pszObjId,
    263302                                                 RTCRKEY hKey, PCRTASN1DYNTYPE pParams, bool fSigning);
     303/** Convenience wrapper function for RTCrPkixSignatureCreate(). */
    264304RTDECL(int) RTCrPkixSignatureCreateByObjId(PRTCRPKIXSIGNATURE phSignature, PCRTASN1OBJID pObjId, RTCRKEY hKey,
    265305                                           PCRTASN1DYNTYPE pParams, bool fSigning);
    266306
    267 
    268 RTDECL(int) RTCrPkixSignatureCreate(PRTCRPKIXSIGNATURE phSignature, PCRTCRPKIXSIGNATUREDESC pDesc, void *pvOpaque,
    269                                     bool fSigning, RTCRKEY hKey, PCRTASN1DYNTYPE pParams);
     307/**
     308 * Retains a reference to the signature schema provider instance.
     309 *
     310 * @returns New reference count on success, UINT32_MAX if invalid handle.
     311 * @param   hSignature      The signature schema provider handle.
     312 */
    270313RTDECL(uint32_t) RTCrPkixSignatureRetain(RTCRPKIXSIGNATURE hSignature);
     314
     315/**
     316 * Releases a reference to the signature schema provider instance.
     317 *
     318 * @returns New reference count on success, UINT32_MAX if invalid handle.
     319 * @param   hSignature      The signature schema provider handle.  NIL is ignored.
     320 */
    271321RTDECL(uint32_t) RTCrPkixSignatureRelease(RTCRPKIXSIGNATURE hSignature);
    272 RTDECL(int) RTCrPkixSignatureVerify(RTCRPKIXSIGNATURE hSignature, RTCRDIGEST hDigest,
    273                                     void const *pvSignature, size_t cbSignature);
     322
     323/**
     324 * Verifies a signed message digest.
     325 *
     326 * @returns IPRT status code.
     327 * @retval  VINF_SUCCESS if the signature checked out correctly.
     328 * @retval  VINF_CR_DIGEST_DEPRECATED if the signature checked out correctly
     329 *          but the hash algorithm is deprecated.
     330 * @retval  VINF_CR_DIGEST_COMPROMISED if the signature checked out correctly
     331 *          but the hash algorithm is compromised.
     332 * @retval  VINF_CR_DIGEST_SEVERELY_COMPROMISED if the signature checked out
     333 *          correctly but the hash algorithm is severely compromised.
     334 * @retval  VERR_PKIX_KEY wrong key or some other key issue.
     335 *
     336 * @param   hSignature      The signature schema provider handle.
     337 * @param   hDigest         The handle to the digest.  Call RTCrDigestFinal to
     338 *                          complete and retreive the final hash value.
     339 * @param   pvSignature     The signature to validate.
     340 * @param   cbSignature     The size of the signature (in bytes).
     341 */
     342RTDECL(int) RTCrPkixSignatureVerify(RTCRPKIXSIGNATURE hSignature, RTCRDIGEST hDigest, void const *pvSignature, size_t cbSignature);
     343/** Convenience wrapper function for RTCrPkixSignatureVerify(). */
    274344RTDECL(int) RTCrPkixSignatureVerifyBitString(RTCRPKIXSIGNATURE hSignature, RTCRDIGEST hDigest, PCRTASN1BITSTRING pSignature);
     345/** Convenience wrapper function for RTCrPkixSignatureVerify(). */
    275346RTDECL(int) RTCrPkixSignatureVerifyOctetString(RTCRPKIXSIGNATURE hSignature, RTCRDIGEST hDigest, PCRTASN1OCTETSTRING pSignature);
    276 RTDECL(int) RTCrPkixSignatureSign(RTCRPKIXSIGNATURE hSignature, RTCRDIGEST hDigest,
    277                                   void *pvSignature, size_t *pcbSignature);
     347
     348/**
     349 * Sign a message digest.
     350 *
     351 * @returns IPRT status code.
     352 * @retval  VINF_SUCCESS on success.
     353 * @retval  VINF_CR_DIGEST_DEPRECATED on success but the hash algorithm is deprecated.
     354 * @retval  VINF_CR_DIGEST_COMPROMISED on success but the hash algorithm is compromised.
     355 * @retval  VINF_CR_DIGEST_SEVERELY_COMPROMISED on success but the hash algorithm
     356 *          is severely compromised.
     357 * @retval  VERR_PKIX_KEY wrong key or some other key issue.
     358 * @retval  VERR_BUFFER_OVERFLOW if the signature buffer is too small, the
     359 *          require buffer size will be available in @a *pcbSignature.
     360 *
     361 * @param   hSignature      The signature schema provider handle.
     362 * @param   hDigest         The handle to the digest.  Call RTCrDigestFinal to
     363 *                          complete and retreive the final hash value.
     364 * @param   pvSignature     The output signature buffer.
     365 * @param   pcbSignature    On input the variable pointed to holds the size of
     366 *                          the buffer @a pvSignature points to.
     367 *                          On return the variable pointed to is set to the size
     368 *                          of the returned signature, or the required size in
     369 *                          case of VERR_BUFFER_OVERFLOW.
     370 */
     371RTDECL(int) RTCrPkixSignatureSign(RTCRPKIXSIGNATURE hSignature, RTCRDIGEST hDigest, void *pvSignature, size_t *pcbSignature);
    278372
    279373
  • trunk/include/iprt/err.h

    r73665 r73705  
    27822782/** OpenSSL failed to clone the digest algorithm context. */
    27832783#define VERR_CR_DIGEST_OSSL_DIGEST_CTX_COPY_ERROR   (-24201)
     2784/** Deprecated digest. */
     2785#define VINF_CR_DIGEST_DEPRECATED                   (24202)
     2786/** Deprecated digest. */
     2787#define VERR_CR_DIGEST_DEPRECATED                   (-24202)
     2788/** Compromised digest. */
     2789#define VINF_CR_DIGEST_COMPROMISED                  (24203)
     2790/** Compromised digest. */
     2791#define VERR_CR_DIGEST_COMPROMISED                  (-24203)
     2792/** Severely compromised digest. */
     2793#define VINF_CR_DIGEST_SEVERELY_COMPROMISED         (24204)
     2794/** Severely compromised digest. */
     2795#define VERR_CR_DIGEST_SEVERELY_COMPROMISED         (-24204)
    27842796/** @} */
    27852797
  • trunk/include/iprt/mangling.h

    r73669 r73705  
    13751375# define RTManifestWriteStandard                        RT_MANGLER(RTManifestWriteStandard)
    13761376# define RTManifestWriteStandardToFile                  RT_MANGLER(RTManifestWriteStandardToFile)
     1377# define RTMd4                                          RT_MANGLER(RTMd4)
     1378# define RTMd4Final                                     RT_MANGLER(RTMd4Final)
     1379# define RTMd4FromString                                RT_MANGLER(RTMd4FromString)
     1380# define RTMd4Init                                      RT_MANGLER(RTMd4Init)
     1381# define RTMd4ToString                                  RT_MANGLER(RTMd4ToString)
     1382# define RTMd4Update                                    RT_MANGLER(RTMd4Update)
    13771383# define RTMd5                                          RT_MANGLER(RTMd5)
    13781384# define RTMd5Final                                     RT_MANGLER(RTMd5Final)
     
    30913097# define RTCrDigestFinal                                RT_MANGLER(RTCrDigestFinal)
    30923098# define RTCrDigestGetConsumedSize                      RT_MANGLER(RTCrDigestGetConsumedSize)
     3099# define RTCrDigestGetFlags                             RT_MANGLER(RTCrDigestGetFlags)
    30933100# define RTCrDigestGetHash                              RT_MANGLER(RTCrDigestGetHash)
    30943101# define RTCrDigestGetHashSize                          RT_MANGLER(RTCrDigestGetHashSize)
  • trunk/include/iprt/md4.h

    r73671 r73705  
    11/** @file
    2  * IPRT - Message-Digest Algorithm 2.
     2 * IPRT - Message-Digest Algorithm 4.
    33 */
    44
    55/*
    6  * Copyright (C) 2006-2017 Oracle Corporation
     6 * Copyright (C) 2006-2018 Oracle Corporation
    77 *
    88 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2424 */
    2525
    26 #ifndef ___iprt_md2_h
    27 #define ___iprt_md2_h
     26#ifndef ___iprt_md4_h
     27#define ___iprt_md4_h
    2828
    2929#include <iprt/types.h>
     
    3131RT_C_DECLS_BEGIN
    3232
    33 /** @defgroup grp_rt_md2    RTMd2 - Message-Digest algorithm 2
     33/** @defgroup grp_rt_md4    RTMd4 - Message-Digest algorithm 4
    3434 * @ingroup grp_rt
     35 *
     36 * @note This is just for backwards compatibility and completeness.
     37 *
    3538 * @{
    3639 */
    3740
    38 /** Size of a MD2 hash. */
    39 #define RTMD2_HASH_SIZE     16
    40 /** The length of a MD2 digest string. The terminator is not included. */
    41 #define RTMD2_DIGEST_LEN    32
     41/** Size of a MD4 hash. */
     42#define RTMD4_HASH_SIZE     16
     43/** The length of a MD4 digest string. The terminator is not included. */
     44#define RTMD4_DIGEST_LEN    32
    4245
    4346/**
    44  * MD2 hash algorithm context.
     47 * MD4 hash algorithm context.
    4548 */
    46 typedef union RTMD2CONTEXT
     49typedef union RTMD4CONTEXT
    4750{
    4851    uint64_t            u64BetterAlignment;
    49     uint8_t             abPadding[4 + 16 + 16*4 + 16*4];
    50 #ifdef RT_MD2_PRIVATE_CONTEXT
    51     MD2_CTX             Private;
     52    uint8_t             abPadding[22*4 + 64 + 8];
     53#ifdef RT_MD4_PRIVATE_CONTEXT
     54    MD4_CTX             Private;
    5255#endif
    53 #ifdef RT_MD2_PRIVATE_ALT_CONTEXT
    54     RTMD2ALTPRIVATECTX  AltPrivate;
     56#ifdef RT_MD4_PRIVATE_ALT_CONTEXT
     57    RTMD4ALTPRIVATECTX  AltPrivate;
    5558#endif
    56 } RTMD2CONTEXT;
     59} RTMD4CONTEXT;
    5760
    58 /** Pointer to MD2 hash algorithm context. */
    59 typedef RTMD2CONTEXT *PRTMD2CONTEXT;
     61/** Pointer to MD4 hash algorithm context. */
     62typedef RTMD4CONTEXT *PRTMD4CONTEXT;
    6063
    6164
    6265/**
    63  * Compute the MD2 hash of the data.
     66 * Compute the MD4 hash of the data.
    6467 *
    6568 * @param   pvBuf       Pointer to data.
     
    6871 *                      (What's passed is a pointer to the caller's buffer.)
    6972 */
    70 RTDECL(void) RTMd2(const void *pvBuf, size_t cbBuf, uint8_t pabDigest[RTMD2_HASH_SIZE]);
     73RTDECL(void) RTMd4(const void *pvBuf, size_t cbBuf, uint8_t pabDigest[RTMD4_HASH_SIZE]);
    7174
    7275/**
    73  * Initialize MD2 context.
     76 * Initialize MD4 context.
    7477 *
    75  * @param   pCtx        Pointer to the MD2 context to initialize.
     78 * @param   pCtx        Pointer to the MD4 context to initialize.
    7679 */
    77 RTDECL(void) RTMd2Init(PRTMD2CONTEXT pCtx);
     80RTDECL(void) RTMd4Init(PRTMD4CONTEXT pCtx);
    7881
    7982/**
    80  * Feed data into the MD2 computation.
     83 * Feed data into the MD4 computation.
    8184 *
    82  * @param   pCtx        Pointer to the MD2 context.
     85 * @param   pCtx        Pointer to the MD4 context.
    8386 * @param   pvBuf       Pointer to data.
    8487 * @param   cbBuf       Length of data (in bytes).
    8588 */
    86 RTDECL(void) RTMd2Update(PRTMD2CONTEXT pCtx, const void *pvBuf, size_t cbBuf);
     89RTDECL(void) RTMd4Update(PRTMD4CONTEXT pCtx, const void *pvBuf, size_t cbBuf);
    8790
    8891/**
    89  * Compute the MD2 hash of the data.
     92 * Compute the MD4 hash of the data.
    9093 *
    91  * @param   pCtx        Pointer to the MD2 context.
     94 * @param   pCtx        Pointer to the MD4 context.
    9295 * @param   pabDigest   Where to store the hash. (What's passed is a pointer to
    9396 *                      the caller's buffer.)
    9497 */
    95 RTDECL(void) RTMd2Final(PRTMD2CONTEXT pCtx, uint8_t pabDigest[RTMD2_HASH_SIZE]);
     98RTDECL(void) RTMd4Final(PRTMD4CONTEXT pCtx, uint8_t pabDigest[RTMD4_HASH_SIZE]);
    9699
    97100/**
    98  * Converts a MD2 hash to a digest string.
     101 * Converts a MD4 hash to a digest string.
    99102 *
    100103 * @returns IPRT status code.
    101104 *
    102  * @param   pabDigest   The binary digest returned by RTMd2Final or RTMd2.
     105 * @param   pabDigest   The binary digest returned by RTMd4Final or RTMd4.
    103106 * @param   pszDigest   Where to return the stringified digest.
    104107 * @param   cchDigest   The size of the output buffer. Should be at least
    105  *                      RTMD2_STRING_LEN + 1 bytes.
     108 *                      RTMD4_STRING_LEN + 1 bytes.
    106109 */
    107 RTDECL(int) RTMd2ToString(uint8_t const pabDigest[RTMD2_HASH_SIZE], char *pszDigest, size_t cchDigest);
     110RTDECL(int) RTMd4ToString(uint8_t const pabDigest[RTMD4_HASH_SIZE], char *pszDigest, size_t cchDigest);
    108111
    109112/**
    110  * Converts a MD2 hash to a digest string.
     113 * Converts a MD4 hash to a digest string.
    111114 *
    112115 * @returns IPRT status code.
     
    117120 *                      the caller's buffer.)
    118121 */
    119 RTDECL(int) RTMd2FromString(char const *pszDigest, uint8_t pabDigest[RTMD2_HASH_SIZE]);
     122RTDECL(int) RTMd4FromString(char const *pszDigest, uint8_t pabDigest[RTMD4_HASH_SIZE]);
    120123
    121124/** @} */
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