Changeset 64817 in vbox for trunk/src/VBox/Runtime/common
- Timestamp:
- Dec 8, 2016 9:44:02 PM (8 years ago)
- Location:
- trunk/src/VBox/Runtime/common
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/asn1/asn1-dump.cpp
r62477 r64817 142 142 } 143 143 else 144 return &g_aSmallOidTable[i Entry];144 return &g_aSmallOidTable[i]; 145 145 } 146 146 } … … 149 149 150 150 151 152 151 /** 153 152 * Queries the name for an object identifier. 154 153 * 155 * @returns true if found, false if not. 154 * @returns IPRT status code (VINF_SUCCESS, VERR_NOT_FOUND, 155 * VERR_BUFFER_OVERFLOW) 156 156 * @param pauComponents The components making up the object ID. 157 157 * @param cComponents The number of components. … … 159 159 * @param cbDst The size of the destination buffer. 160 160 */ 161 static bool rtOidDbQueryObjIdName(uint32_t const *pauComponents, uint8_t cComponents, char *pszDst, size_t cbDst) 162 { 161 static int rtOidDbQueryObjIdName(uint32_t const *pauComponents, uint8_t cComponents, char *pszDst, size_t cbDst) 162 { 163 int rc = VERR_NOT_FOUND; 163 164 if (cComponents > 0) 164 165 { … … 181 182 if (RTBldProgStrTabQueryString(&g_OidDbStrTab, pSmallHit->offString, 182 183 pSmallHit->cchString, pszDst, cbDst) >= 0) 183 return true; 184 return VINF_SUCCESS; 185 rc = VERR_BUFFER_OVERFLOW; 184 186 break; 185 187 } … … 202 204 if (RTBldProgStrTabQueryString(&g_OidDbStrTab, pBigHit->offString, 203 205 pBigHit->cchString, pszDst, cbDst) >= 0) 204 return true; 206 return VINF_SUCCESS; 207 rc = VERR_BUFFER_OVERFLOW; 205 208 break; 206 209 } … … 218 221 } 219 222 220 return false; 223 return rc; 224 } 225 226 227 /** 228 * Queries the name for an object identifier. 229 * 230 * This API is simple and more or less requires a 231 * 232 * @returns IPRT status code. 233 * @retval VINF_SUCCESS on success. 234 * @retval VERR_NOT_FOUND if not found. 235 * @retval VERR_BUFFER_OVERFLOW if more buffer space is required. 236 * 237 * @param pauComponents The components making up the object ID. 238 * @param cComponents The number of components. 239 * @param pszDst Where to store the name if found. 240 * @param cbDst The size of the destination buffer. 241 */ 242 RTDECL(int) RTAsn1QueryObjIdName(PCRTASN1OBJID pObjId, char *pszDst, size_t cbDst) 243 { 244 return rtOidDbQueryObjIdName(pObjId->pauComponents, pObjId->cComponents, pszDst, cbDst); 221 245 } 222 246 … … 422 446 PCRTASN1OBJID pObjId = (PCRTASN1OBJID)pAsn1Core; 423 447 char szName[64]; 424 if (rtOidDbQueryObjIdName(pObjId->pauComponents, pObjId->cComponents, szName, sizeof(szName)) )448 if (rtOidDbQueryObjIdName(pObjId->pauComponents, pObjId->cComponents, szName, sizeof(szName)) == VINF_SUCCESS) 425 449 rtAsn1DumpPrintf(pData, "OBJECT IDENTIFIER %s%s ('%s')\n", 426 450 pszDefault, szName, ((PCRTASN1OBJID)pAsn1Core)->szObjId); -
trunk/src/VBox/Runtime/common/crypto/digest-core.cpp
r62477 r64817 398 398 } 399 399 400 401 RTDECL(const char *) RTCrDigestTypeToName(RTDIGESTTYPE enmDigestType) 402 { 403 switch (enmDigestType) 404 { 405 case RTDIGESTTYPE_CRC32: return "CRC32"; 406 case RTDIGESTTYPE_CRC64: return "CRC64"; 407 case RTDIGESTTYPE_MD2: return "MD2"; 408 case RTDIGESTTYPE_MD4: return "MD4"; 409 case RTDIGESTTYPE_MD5: return "MD5"; 410 case RTDIGESTTYPE_SHA1: return "SHA-1"; 411 case RTDIGESTTYPE_SHA224: return "SHA-224"; 412 case RTDIGESTTYPE_SHA256: return "SHA-256"; 413 case RTDIGESTTYPE_SHA384: return "SHA-384"; 414 case RTDIGESTTYPE_SHA512: return "SHA-512"; 415 case RTDIGESTTYPE_SHA512T224: return "SHA-512/224"; 416 case RTDIGESTTYPE_SHA512T256: return "SHA-512/256"; 417 default: return NULL; 418 } 419 } 420
Note:
See TracChangeset
for help on using the changeset viewer.