Changeset 66295 in vbox for trunk/src/VBox/Frontends/VBoxManage
- Timestamp:
- Mar 28, 2017 11:51:16 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
r66204 r66295 1144 1144 case 'a': 1145 1145 lstLicenseHashes.append(ValueUnion.psz); 1146 lstLicenseHashes[lstLicenseHashes.size() - 1].toLower(); 1146 1147 break; 1147 1148 … … 1181 1182 Utf8Str strLicense(bstrLicense); 1182 1183 uint8_t abHash[RTSHA256_HASH_SIZE]; 1184 char szDigest[RTSHA256_DIGEST_LEN + 1]; 1183 1185 RTSha256(strLicense.c_str(), strLicense.length(), abHash); 1184 char *pszDigest = NULL; 1185 vrc = RTStrAllocEx(&pszDigest, RTSHA256_DIGEST_LEN + 1); 1186 if (RT_SUCCESS(vrc)) 1187 RTSha256ToString(abHash, pszDigest, RTSHA256_DIGEST_LEN + 1); 1188 if ( pszDigest 1189 && lstLicenseHashes.contains(pszDigest)) 1186 vrc = RTSha256ToString(abHash, szDigest, sizeof(szDigest)); 1187 AssertRCStmt(vrc, szDigest[0] = '\0'); 1188 if (lstLicenseHashes.contains(szDigest)) 1190 1189 RTPrintf("License accepted.\n"); 1191 1190 else 1192 1191 { 1193 RTPrintf("% ls\n", bstrLicense.raw());1192 RTPrintf("%s\n", srcLicense.c_str()); 1194 1193 RTPrintf("Do you agree to these license terms and conditions (y/n)? " ); 1195 1194 ch = RTStrmGetCh(g_pStdIn); … … 1198 1197 { 1199 1198 RTPrintf("Installation of \"%ls\" aborted.\n", bstrName.raw()); 1200 if (pszDigest)1201 RTStrFree(pszDigest);1202 1199 return RTEXITCODE_SUCCESS; 1203 1200 } 1204 if (pszDigest) 1205 { 1201 if (szDigest[0]) 1206 1202 RTPrintf("License accepted. For batch installaltion add\n" 1207 1203 "--accept-license=%s\n" 1208 "to the VBoxManage command line.\n\n", pszDigest); 1209 } 1210 } 1211 if (pszDigest) 1212 RTStrFree(pszDigest); 1204 "to the VBoxManage command line.\n\n", szDigest); 1205 } 1213 1206 } 1214 1207 ComPtr<IProgress> ptrProgress;
Note:
See TracChangeset
for help on using the changeset viewer.