Changeset 57613 in vbox for trunk/include
- Timestamp:
- Sep 4, 2015 2:19:44 AM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 102486
- Location:
- trunk/include/iprt
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/crypto/store.h
r57584 r57613 29 29 #include <iprt/crypto/x509.h> 30 30 #include <iprt/crypto/taf.h> 31 #include <iprt/sha.h> 31 32 32 33 … … 56 57 /** Pointer to a certificate store search. */ 57 58 typedef RTCRSTORECERTSEARCH *PRTCRSTORECERTSEARCH; 59 60 61 /** 62 * Info about a wanted certificate. 63 * 64 * All the search criteria are optional, but for a safe and efficient search 65 * it's recommended to specify all possible ones. If none are given, the search 66 * function will fail. 67 * 68 * For use with RTCrStoreCertAddFromFishingExpedition and others. 69 */ 70 typedef struct RTCRCERTWANTED 71 { 72 /** The certificate subject name, optional. 73 * The format is: "C=US, ST=California, L=Redwood Shores, O=Oracle Corporation" */ 74 const char *pszSubject; 75 /** The size of the DER (ASN.1) encoded certificate, optional (0). */ 76 uint16_t cbEncoded; 77 /** Set if abSha1 contains a valid SHA-1 fingerprint. */ 78 bool fSha1Fingerprint; 79 /** Set if abSha512 contains a valid SHA-512 fingerprint. */ 80 bool fSha512Fingerprint; 81 /** The SHA-1 fingerprint (of the encoded data). */ 82 uint8_t abSha1[RTSHA1_HASH_SIZE]; 83 /** The SHA-512 fingerprint (of the encoded data). */ 84 uint8_t abSha512[RTSHA512_HASH_SIZE]; 85 /** User pointer for directly associating other data with the entry. 86 * Subclassing the structure isn't possible because it's passed as an array. */ 87 void const *pvUser; 88 } RTCRCERTWANTED; 89 /** Pointer to a const certificat wanted structure. */ 90 typedef RTCRCERTWANTED const *PCRTCRCERTWANTED; 58 91 59 92 … … 162 195 PCRTSTRTUPLE paSuffixes, size_t cSuffixes, PRTERRINFO pErrInfo); 163 196 197 RTDECL(int) RTCrStoreCertAddWantedFromDir(RTCRSTORE hStore, uint32_t fFlags, 198 const char *pszDir, PCRTSTRTUPLE paSuffixes, size_t cSuffixes, 199 PCRTCRCERTWANTED paWanted, size_t cWanted, bool *pafFound, PRTERRINFO pErrInfo); 200 164 201 /** 165 202 * Adds certificates from the specified file. … … 183 220 RTDECL(int) RTCrStoreCertAddFromFile(RTCRSTORE hStore, uint32_t fFlags, const char *pszFilename, PRTERRINFO pErrInfo); 184 221 222 RTDECL(int) RTCrStoreCertAddWantedFromFile(RTCRSTORE hStore, uint32_t fFlags, const char *pszFilename, 223 PCRTCRCERTWANTED paWanted, size_t cWanted, bool *pafFound, PRTERRINFO pErrInfo); 224 185 225 /** 186 226 * Adds certificates from the specified java key store file. … … 229 269 */ 230 270 RTDECL(int) RTCrStoreCertAddFromStore(RTCRSTORE hStore, uint32_t fFlags, RTCRSTORE hStoreSrc); 271 272 RTDECL(int) RTCrStoreCertAddWantedFromStore(RTCRSTORE hStore, uint32_t fFlags, RTCRSTORE hSrcStore, 273 PCRTCRCERTWANTED paWanted, size_t cWanted, bool *pafFound); 274 275 RTDECL(int) RTCrStoreCertCheckWanted(RTCRSTORE hStore, PCRTCRCERTWANTED paWanted, size_t cWanted, bool *pafFound); 276 277 278 RTDECL(int) RTCrStoreCertAddWantedFromFishingExpedition(RTCRSTORE hStore, uint32_t fFlags, 279 PCRTCRCERTWANTED paWanted, size_t cWanted, 280 bool *pafFound, PRTERRINFO pErrInfo); 231 281 232 282 /** … … 240 290 */ 241 291 RTDECL(int) RTCrStoreCertExportAsPem(RTCRSTORE hStore, uint32_t fFlags, const char *pszFilename); 292 293 /** 294 * Counts the number of certificates in the store. 295 * 296 * @returns Certificate count on success, UINT32_MAX on failure. 297 * @param hStore The store which certificates should be counted. 298 */ 299 RTDECL(uint32_t) RTCrStoreCertCount(RTCRSTORE hStore); 242 300 243 301 RTDECL(int) RTCrStoreCertFindAll(RTCRSTORE hStore, PRTCRSTORECERTSEARCH pSearch); -
trunk/include/iprt/dir.h
r56291 r57613 236 236 * 237 237 * This is the RTFS_TYPE_MASK stuff shifted down 12 bits and 238 * identical to the BSD/LINUX ABI. 238 * identical to the BSD/LINUX ABI. See RTFS_TYPE_DIRENTRYTYPE_SHIFT. 239 239 */ 240 240 typedef enum RTDIRENTRYTYPE -
trunk/include/iprt/err.h
r57516 r57613 2478 2478 /** @name RTCrDigest status codes. 2479 2479 * @{ */ 2480 /** OpenSSL failed to initialize the digest algorithm context n. */2480 /** OpenSSL failed to initialize the digest algorithm context. */ 2481 2481 #define VERR_CR_DIGEST_OSSL_DIGEST_INIT_ERROR (-24200) 2482 2482 /** OpenSSL failed to clone the digest algorithm context. */ … … 2484 2484 /** @} */ 2485 2485 2486 /** @name RTPath status codes. 2487 * @{ */ 2488 /** Unknown glob variable. */ 2489 #define VERR_PATH_MATCH_UNKNOWN_VARIABLE (-24400) 2490 /** The specified glob variable must be first in the pattern. */ 2491 #define VERR_PATH_MATCH_VARIABLE_MUST_BE_FIRST (-24401) 2492 /** Hit unimplemented glob pattern matching feature. */ 2493 #define VERR_PATH_MATCH_FEATURE_NOT_IMPLEMENTED (-24402) 2494 /** Unknown character class in glob pattern. */ 2495 #define VERR_PATH_GLOB_UNKNOWN_CHAR_CLASS (-24403) 2496 /** @} */ 2497 2486 2498 /* SED-END */ 2487 2499 -
trunk/include/iprt/file.h
r57004 r57613 778 778 RTDECL(int) RTFileCreateTempSecure(char *pszTemplate); 779 779 780 /** 781 * Opens a new file with a unique name in the temp directory. 782 * 783 * @returns iprt status code. 784 * @param pszTemplate The file name template on input. The actual file 785 * name on success. Empty string on failure. 786 * @param fMode The mode to create the file with. Use 0600 unless 787 * you have reason not to. 788 * 789 * @remarks If actual control over the filename or location is required, we'll 790 * create an extended edition of this API. 791 */ 792 RTDECL(int) RTFileOpenTemp(PRTFILE pFile, char *pszFilename, size_t cbFilename, uint64_t fOpen); 793 780 794 781 795 /** @page pg_rt_filelock RT File locking API description -
trunk/include/iprt/fs.h
r56291 r57613 117 117 /** Type mask (S_IFMT). */ 118 118 #define RTFS_TYPE_MASK 0170000U 119 /** The shift count to convert between RTFS_TYPE_MASK and DIRENTRYTYPE. */ 120 #define RTFS_TYPE_DIRENTRYTYPE_SHIFT 12 119 121 120 122 /** Unix attribute mask. */ … … 593 595 RTR3DECL(int) RTFsQueryProperties(const char *pszFsPath, PRTFSPROPERTIES pProperties); 594 596 597 /** 598 * Checks if the given volume is case sensitive or not. 599 * 600 * This may be misleading in some cases as we lack the necessary APIs to query 601 * the information on some system (or choose not to use them) and are instead 602 * returning the general position on case sensitive file name of the system. 603 * 604 * @returns @c true if case sensitive, @c false if not. 605 * @param pszFsPath Path within the mounted file system. 606 */ 607 RTR3DECL(bool) RTFsIsCaseSensitive(const char *pszFsPath); 595 608 596 609 /** -
trunk/include/iprt/http.h
r57577 r57613 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT - Simple HTTP CommunicationAPI.3 * IPRT - Simple HTTP/HTTPS Client API. 4 4 */ 5 5 … … 32 32 RT_C_DECLS_BEGIN 33 33 34 /** @defgroup grp_rt_http RTHttp - Simple HTTP API34 /** @defgroup grp_rt_http RTHttp - Simple HTTP/HTTPS Client API 35 35 * @ingroup grp_rt 36 36 * @{ … … 38 38 39 39 /** @todo the following three definitions may move the iprt/types.h later. */ 40 /** RTHTTP interfacehandle. */40 /** HTTP/HTTPS client handle. */ 41 41 typedef R3PTRTYPE(struct RTHTTPINTERNAL *) RTHTTP; 42 /** Pointer to a RTHTTP interfacehandle. */43 typedef RTHTTP 44 /** Nil RTHTTP interfacehandle. */42 /** Pointer to a HTTP/HTTPS client handle. */ 43 typedef RTHTTP *PRTHTTP; 44 /** Nil HTTP/HTTPS client handle. */ 45 45 #define NIL_RTHTTP ((RTHTTP)0) 46 46 47 47 48 48 /** 49 * Creates a HTTP interface handle.49 * Creates a HTTP client instance. 50 50 * 51 51 * @returns iprt status code. … … 56 56 57 57 /** 58 * Destroys a HTTP interface handle.58 * Destroys a HTTP client instance. 59 59 * 60 60 * @param hHttp Handle to the HTTP interface. … … 80 80 * @returns iprt status code. 81 81 * 82 * @param hHttp HTTP interface handle.83 * @param p cszUrlURL.82 * @param hHttp The HTTP client instance. 83 * @param pszUrl URL. 84 84 * @param ppszNotUtf8 Where to return the poitner to the HTTP response. 85 85 * The string is of course zero terminated. Use … … 99 99 * containing embedded zero's, use RTHttpGetBinary instead. 100 100 */ 101 RTR3DECL(int) RTHttpGetText(RTHTTP hHttp, const char *p cszUrl, char **ppszNotUtf8);101 RTR3DECL(int) RTHttpGetText(RTHTTP hHttp, const char *pszUrl, char **ppszNotUtf8); 102 102 103 103 /** … … 113 113 * @returns iprt status code. 114 114 * 115 * @param hHttp HTTP interface handle.116 * @param p cszUrlThe URL.115 * @param hHttp The HTTP client instance. 116 * @param pszUrl The URL. 117 117 * @param ppvResponse Where to store the HTTP response data. Use 118 118 * RTHttpFreeResponse to free. 119 119 * @param pcb Size of the returned buffer. 120 120 */ 121 RTR3DECL(int) RTHttpGetBinary(RTHTTP hHttp, const char *p cszUrl, void **ppvResponse, size_t *pcb);121 RTR3DECL(int) RTHttpGetBinary(RTHTTP hHttp, const char *pszUrl, void **ppvResponse, size_t *pcb); 122 122 123 123 /** … … 133 133 * @returns iprt status code. 134 134 * 135 * @param hHttp HTTP interface handle.135 * @param hHttp The HTTP client instance. 136 136 * @param pszUrl The URL. 137 137 * @param pszDstFile The destination file name. … … 146 146 * @returns iprt status code. 147 147 * 148 * @param hHttp HTTP interface handle.148 * @param hHttp The HTTP client instance. 149 149 */ 150 150 RTR3DECL(int) RTHttpAbort(RTHTTP hHttp); … … 154 154 * 155 155 * @returns iprt status code. 156 * @param hHttp HTTP interface handle.156 * @param hHttp The HTTP client instance. 157 157 */ 158 158 RTR3DECL(int) RTHttpUseSystemProxySettings(RTHTTP hHttp); … … 163 163 * @returns iprt status code. 164 164 * 165 * @param hHttp HTTP interface handle.166 * @param p cszProxyURL of the proxy.165 * @param hHttp The HTTP client instance. 166 * @param pszProxy URL of the proxy. 167 167 * @param uPort port number of the proxy, use 0 for not specifying a port. 168 * @param p cszUserUsername, pass NULL for no authentication.169 * @param p cszPwdPassword, pass NULL for no authentication.170 */ 171 RTR3DECL(int) RTHttpSetProxy(RTHTTP hHttp, const char *p cszProxyUrl, uint32_t uPort,172 const char *p cszProxyUser, const char *pcszProxyPwd);168 * @param pszProxyUser Username, pass NULL for no authentication. 169 * @param pszProxyPwd Password, pass NULL for no authentication. 170 */ 171 RTR3DECL(int) RTHttpSetProxy(RTHTTP hHttp, const char *pszProxyUrl, uint32_t uPort, 172 const char *pszProxyUser, const char *pszProxyPwd); 173 173 174 174 /** … … 177 177 * @returns iprt status code. 178 178 * 179 * @param hHttp HTTP interface handle.179 * @param hHttp The HTTP client instance. 180 180 * @param cHeaders Number of custom headers. 181 * @param p cszHeadersArray of headers in form "foo: bar".181 * @param papszHeaders Array of headers in form "foo: bar". 182 182 */ 183 183 RTR3DECL(int) RTHttpSetHeaders(RTHTTP hHttp, size_t cHeaders, const char * const *papszHeaders); 184 184 185 185 /** 186 * Tells the HTTP client instance to gather system CA certificates into a 187 * temporary file and use it for HTTPS connections. 188 * 189 * This will be called automatically if a 'https' URL is presented and 190 * RTHttpSetCaFile hasn't been called yet. 191 * 192 * @returns IPRT status code. 193 * @param hHttp The HTTP client instance. 194 * @param pErrInfo Where to store additional error/warning information. 195 * Optional. 196 */ 197 RTR3DECL(int) RTHttpUseTemporaryCaFile(RTHTTP hHttp, PRTERRINFO pErrInfo); 198 199 /** 186 200 * Set a custom certification authority file, containing root certificates. 187 201 * 188 202 * @returns iprt status code. 189 203 * 190 * @param hHttp HTTP interface handle. 191 * @param pcszCAFile File name containing root certificates. 192 */ 193 RTR3DECL(int) RTHttpSetCAFile(RTHTTP hHttp, const char *pcszCAFile); 194 204 * @param hHttp The HTTP client instance. 205 * @param pszCAFile File name containing root certificates. 206 * 207 * @remarks For portable HTTPS support, use RTHttpGatherCaCertsInFile and pass 208 */ 209 RTR3DECL(int) RTHttpSetCAFile(RTHTTP hHttp, const char *pszCAFile); 210 211 /** 212 * Gathers certificates into a cryptographic (certificate) store 213 * 214 * This is a just a combination of RTHttpGatherCaCertsInStore and 215 * RTCrStoreCertExportAsPem. 216 * 217 * @returns IPRT status code. 218 * @param hStore The certificate store to gather the certificates 219 * in. 220 * @param fFlags RTHTTPGATHERCACERT_F_XXX. 221 * @param pErrInfo Where to store additional error/warning information. 222 * Optional. 223 */ 224 RTR3DECL(int) RTHttpGatherCaCertsInStore(RTCRSTORE hStore, uint32_t fFlags, PRTERRINFO pErrInfo); 225 226 /** 227 * Gathers certificates into a file that can be used with RTHttpSetCAFile. 228 * 229 * This is a just a combination of RTHttpGatherCaCertsInStore and 230 * RTCrStoreCertExportAsPem. 231 * 232 * @returns IPRT status code. 233 * @param pszCaFile The output file. 234 * @param fFlags RTHTTPGATHERCACERT_F_XXX. 235 * @param pErrInfo Where to store additional error/warning information. 236 * Optional. 237 */ 238 RTR3DECL(int) RTHttpGatherCaCertsInFile(const char *pszCaFile, uint32_t fFlags, PRTERRINFO pErrInfo); 195 239 196 240 /** @} */ -
trunk/include/iprt/mangling.h
r57584 r57613 603 603 # define RTFileOpenF RT_MANGLER(RTFileOpenF) 604 604 # define RTFileOpenV RT_MANGLER(RTFileOpenV) 605 # define RTFileOpenTemp RT_MANGLER(RTFileOpenTemp) 605 606 # define RTFileQueryFsSizes RT_MANGLER(RTFileQueryFsSizes) 606 607 # define RTFileQueryInfo RT_MANGLER(RTFileQueryInfo) … … 628 629 # define RTFileWriteAt RT_MANGLER(RTFileWriteAt) 629 630 # define RTFilesystemVfsFromFile RT_MANGLER(RTFilesystemVfsFromFile) 631 # define RTFsIsCaseSensitive RT_MANGLER(RTFsIsCaseSensitive) 630 632 # define RTFsQueryProperties RT_MANGLER(RTFsQueryProperties) 631 633 # define RTFsQuerySerial RT_MANGLER(RTFsQuerySerial) … … 1061 1063 # define RTPathGetCurrentOnDrive RT_MANGLER(RTPathGetCurrentOnDrive) 1062 1064 # define RTPathGetMode RT_MANGLER(RTPathGetMode) 1065 # define RTPathGlob RT_MANGLER(RTPathGlob) 1066 # define RTPathGlobFree RT_MANGLER(RTPathGlobFree) 1063 1067 # define RTPathHasSuffix RT_MANGLER(RTPathHasSuffix) 1064 1068 # define RTPathHasPath RT_MANGLER(RTPathHasPath) … … 2892 2896 # define RTCrStoreCertAddEncoded RT_MANGLER(RTCrStoreCertAddEncoded) 2893 2897 # define RTCrStoreCertByIssuerAndSerialNo RT_MANGLER(RTCrStoreCertByIssuerAndSerialNo) 2898 # define RTCrStoreCertCount RT_MANGLER(RTCrStoreCertCount) 2894 2899 # define RTCrStoreCertFindAll RT_MANGLER(RTCrStoreCertFindAll) 2895 2900 # define RTCrStoreCertFindBySubjectOrAltSubjectByRfc5280 RT_MANGLER(RTCrStoreCertFindBySubjectOrAltSubjectByRfc5280) … … 2907 2912 # define RTCrStoreCertAddFromJavaKeyStoreInMem RT_MANGLER(RTCrStoreCertAddFromJavaKeyStoreInMem) 2908 2913 # define RTCrStoreCertAddFromStore RT_MANGLER(RTCrStoreCertAddFromStore) 2914 # define RTCrStoreCertAddWantedFromDir RT_MANGLER(RTCrStoreCertAddWantedFromDir) 2915 # define RTCrStoreCertAddWantedFromFile RT_MANGLER(RTCrStoreCertAddWantedFromFile) 2916 # define RTCrStoreCertAddWantedFromStore RT_MANGLER(RTCrStoreCertAddWantedFromStore) 2917 # define RTCrStoreCertAddWantedFromFishingExpedition RT_MANGLER(RTCrStoreCertAddWantedFromFishingExpedition) 2918 # define RTCrStoreCertCheckWanted RT_MANGLER(RTCrStoreCertCheckWanted) 2909 2919 # define RTCrStoreCertExportAsPem RT_MANGLER(RTCrStoreCertExportAsPem) 2910 2920 # define RTErrInfoAdd RT_MANGLER(RTErrInfoAdd) -
trunk/include/iprt/path.h
r57572 r57613 601 601 * The first component is the root, volume or UNC specifier, if present. Use 602 602 * RTPATH_PROP_HAS_ROOT_SPEC() on RTPATHPARSED::fProps to determine its 603 * pre cense.603 * presence. 604 604 * 605 605 * Other than the root component, no component will include directory separators … … 1172 1172 RTDECL(int) RTPathTemp(char *pszPath, size_t cchPath); 1173 1173 1174 1175 /** 1176 * RTPathGlobl result entry. 1177 */ 1178 typedef struct RTPATHGLOBENTRY 1179 { 1180 /** List entry. */ 1181 struct RTPATHGLOBENTRY *pNext; 1182 /** RTDIRENTRYTYPE value. */ 1183 uint8_t uType; 1184 /** Unused explicit padding. */ 1185 uint8_t bUnused; 1186 /** The length of the path. */ 1187 uint16_t cchPath; 1188 /** The path to the file (variable length). */ 1189 char szPath[1]; 1190 } RTPATHGLOBENTRY; 1191 /** Pointer to a GLOB result entry. */ 1192 typedef RTPATHGLOBENTRY *PRTPATHGLOBENTRY; 1193 /** Pointer to a const GLOB result entry. */ 1194 typedef RTPATHGLOBENTRY const *PCRTPATHGLOBENTRY; 1195 /** Pointer to a GLOB result entry pointer. */ 1196 typedef PCRTPATHGLOBENTRY *PPCRTPATHGLOBENTRY; 1197 1198 /** 1199 * Performs wildcard expansion on a path pattern. 1200 * 1201 * @returns IPRT status code. 1202 * 1203 * @param pszPattern The pattern to expand. 1204 * @param fFlags RTPATHGLOB_F_XXX. 1205 * @param ppHead Where to return the head of the result list. This 1206 * is always set to NULL on failure. 1207 * @param pcResults Where to return the number of the result. Optional. 1208 */ 1209 RTDECL(int) RTPathGlob(const char *pszPattern, uint32_t fFlags, PPCRTPATHGLOBENTRY ppHead, uint32_t *pcResults); 1210 1211 /** @name RTPATHGLOB_F_XXX - RTPathGlob flags 1212 * @{ */ 1213 /** Case insensitive. */ 1214 #define RTPATHGLOB_F_IGNORE_CASE RT_BIT_32(0) 1215 /** Do not expand \${EnvOrSpecialVariable} in the pattern. */ 1216 #define RTPATHGLOB_F_NO_VARIABLES RT_BIT_32(1) 1217 /** Do not interpret a leading tilde as a home directory reference. */ 1218 #define RTPATHGLOB_F_NO_TILDE RT_BIT_32(2) 1219 /** Only return the first match. */ 1220 #define RTPATHGLOB_F_FIRST_ONLY RT_BIT_32(3) 1221 /** Only match directories (implied if pattern ends with slash). */ 1222 #define RTPATHGLOB_F_ONLY_DIRS RT_BIT_32(4) 1223 /** Do not match directories. (Can't be used with RTPATHGLOB_F_ONLY_DIRS or 1224 * patterns containing a trailing slash.) */ 1225 #define RTPATHGLOB_F_NO_DIRS RT_BIT_32(5) 1226 /** Disables the '**' wildcard pattern for matching zero or more subdirs. */ 1227 #define RTPATHGLOB_F_NO_STARSTAR RT_BIT_32(6) 1228 /** Mask of valid flags. */ 1229 #define RTPATHGLOB_F_MASK UINT32_C(0x0000007f) 1230 /** @} */ 1231 1232 /** 1233 * Frees the results produced by RTPathGlob. 1234 * 1235 * @param pHead What RTPathGlob returned. NULL ignored. 1236 */ 1237 RTDECL(void) RTPathGlobFree(PCRTPATHGLOBENTRY pHead); 1238 1239 1174 1240 /** 1175 1241 * Query information about a file system object.
Note:
See TracChangeset
for help on using the changeset viewer.