diff options
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/CryptoGridAssetClient.cs')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/CryptoGridAssetClient.cs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CryptoGridAssetClient.cs b/OpenSim/Framework/Communications/Cache/CryptoGridAssetClient.cs index 0f4e8ac..f1c19fa 100644 --- a/OpenSim/Framework/Communications/Cache/CryptoGridAssetClient.cs +++ b/OpenSim/Framework/Communications/Cache/CryptoGridAssetClient.cs | |||
@@ -441,17 +441,17 @@ namespace OpenSim.Framework.Communications.Cache | |||
441 | string salt = Convert.ToBase64String(rand); | 441 | string salt = Convert.ToBase64String(rand); |
442 | 442 | ||
443 | x.Data = UtilRijndael.Encrypt(x.Data, file.Secret, salt, "SHA1", 2, file.IVBytes, file.Keysize); | 443 | x.Data = UtilRijndael.Encrypt(x.Data, file.Secret, salt, "SHA1", 2, file.IVBytes, file.Keysize); |
444 | x.Metadata.Description = String.Format("ENCASS#:~:#{0}#:~:#{1}#:~:#{2}#:~:#{3}", | 444 | x.Description = String.Format("ENCASS#:~:#{0}#:~:#{1}#:~:#{2}#:~:#{3}", |
445 | "OPENSIM_AES_AF1", | 445 | "OPENSIM_AES_AF1", |
446 | file.AlsoKnownAs, | 446 | file.AlsoKnownAs, |
447 | salt, | 447 | salt, |
448 | x.Metadata.Description); | 448 | x.Description); |
449 | } | 449 | } |
450 | 450 | ||
451 | private bool DecryptAssetBase(AssetBase x) | 451 | private bool DecryptAssetBase(AssetBase x) |
452 | { | 452 | { |
453 | // Check it's encrypted first. | 453 | // Check it's encrypted first. |
454 | if (!x.Metadata.Description.Contains("ENCASS")) | 454 | if (!x.Description.Contains("ENCASS")) |
455 | return true; | 455 | return true; |
456 | 456 | ||
457 | // ENCASS:ALG:AKA:SALT:Description | 457 | // ENCASS:ALG:AKA:SALT:Description |
@@ -459,7 +459,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
459 | string[] splitchars = new string[1]; | 459 | string[] splitchars = new string[1]; |
460 | splitchars[0] = "#:~:#"; | 460 | splitchars[0] = "#:~:#"; |
461 | 461 | ||
462 | string[] meta = x.Metadata.Description.Split(splitchars, StringSplitOptions.None); | 462 | string[] meta = x.Description.Split(splitchars, StringSplitOptions.None); |
463 | if (meta.Length < 5) | 463 | if (meta.Length < 5) |
464 | { | 464 | { |
465 | m_log.Warn("[ENCASSETS] Recieved Encrypted Asset, but header is corrupt"); | 465 | m_log.Warn("[ENCASSETS] Recieved Encrypted Asset, but header is corrupt"); |
@@ -470,7 +470,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
470 | if (m_keyfiles.ContainsKey(meta[2])) | 470 | if (m_keyfiles.ContainsKey(meta[2])) |
471 | { | 471 | { |
472 | RjinKeyfile deckey = m_keyfiles[meta[2]]; | 472 | RjinKeyfile deckey = m_keyfiles[meta[2]]; |
473 | x.Metadata.Description = meta[4]; | 473 | x.Description = meta[4]; |
474 | switch (meta[1]) | 474 | switch (meta[1]) |
475 | { | 475 | { |
476 | case "OPENSIM_AES_AF1": | 476 | case "OPENSIM_AES_AF1": |
@@ -544,7 +544,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
544 | { | 544 | { |
545 | string assetUrl = _assetServerUrl + "/assets/"; | 545 | string assetUrl = _assetServerUrl + "/assets/"; |
546 | 546 | ||
547 | m_log.InfoFormat("[CRYPTO GRID ASSET CLIENT]: Sending store request for asset {0}", asset.Metadata.FullID); | 547 | m_log.InfoFormat("[CRYPTO GRID ASSET CLIENT]: Sending store request for asset {0}", asset.FullID); |
548 | 548 | ||
549 | RestObjectPoster.BeginPostObject<AssetBase>(assetUrl, asset); | 549 | RestObjectPoster.BeginPostObject<AssetBase>(assetUrl, asset); |
550 | } | 550 | } |