1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-22 08:52:15 -05:00

cleanup strict mode function placement

This commit is contained in:
Tankred Hase 2013-04-02 15:02:57 +02:00
parent 5c0e04cc31
commit ef54dc3aae
12 changed files with 1250 additions and 1295 deletions

View File

@ -1,10 +1,8 @@
(function() {
'use strict';
/**
* A Wrapper for Crypto.js's AES-CBC encryption
*/
app.crypto.AesCBC = function() {
'use strict';
var mode = CryptoJS.mode.CBC; // use CBC mode for Crypto.js
var padding = CryptoJS.pad.Pkcs7; // use Pkcs7/Pkcs5 padding for Crypto.js
@ -55,5 +53,3 @@
};
};
}());

View File

@ -1,10 +1,8 @@
(function() {
'use strict';
/**
* A Wrapper for SJCL's authenticated AES-CCM encryption
*/
app.crypto.AesCCM = function() {
'use strict';
var adata = []; // authenticated data (empty by default)
var tlen = 64; // The tag length in bits
@ -50,5 +48,3 @@
};
};
}());

View File

@ -1,10 +1,8 @@
(function() {
'use strict';
/**
* A Wrapper for SJCL's authenticated AES-GCM encryption
*/
app.crypto.AesGCM = function() {
'use strict';
var adata = []; // authenticated data (empty by default)
var tlen = 128; // The tag length in bits
@ -50,5 +48,3 @@
};
};
}());

View File

@ -1,11 +1,9 @@
(function() {
'use strict';
/**
* High level crypto api that invokes native crypto (if available) and
* gracefully degrades to JS crypto (if unavailable)
*/
app.crypto.Crypto = function(window, util) {
'use strict';
var symmetricUserKey, // the user's secret key used to encrypt item-keys
aes = new app.crypto.AesCCM(); // use authenticated AES-CCM mode by default
@ -245,5 +243,3 @@
};
};
}());

View File

@ -1,10 +1,8 @@
(function() {
'use strict';
/**
* A Wrapper for Crypto.js's PBKDF2 function
*/
app.crypto.PBKDF2 = function() {
'use strict';
/**
* PBKDF2-HMAC-SHA1 key derivation with a constant salt and 1000 iterations
@ -24,5 +22,3 @@
};
};
}());

View File

@ -1,10 +1,8 @@
(function() {
'use strict';
/**
* A wrapper for asymmetric OpenPGP encryption logic
*/
app.crypto.PGP = function(window, openpgp, util, server) {
'use strict';
var self = this,
privateKey, // user's private key
@ -336,8 +334,6 @@
};
}());
/**
* This function needs to be implemented, since it is used by the openpgp utils
*/

View File

@ -1,7 +1,8 @@
(function() {
'use strict';
/**
* Various utitity methods for crypto, encoding & decoding
*/
app.crypto.Util = function(window, uuid) {
'use strict';
/**
* Generates a new RFC 4122 version 4 compliant random UUID
@ -164,5 +165,3 @@
};
};
}());

View File

@ -1,11 +1,9 @@
(function() {
'use strict';
/**
* High level storage api for handling syncing of data to
* and from the cloud.
*/
app.dao.CloudStorage = function(window, $) {
'use strict';
/**
* Lists the encrypted items
@ -127,5 +125,3 @@
};
};
}());

View File

@ -1,6 +1,3 @@
(function() {
'use strict';
/**
* High level storage api that handles all persistence on the device. If
* SQLcipher/SQLite is available, all data is securely persisted there,
@ -8,6 +5,7 @@
* used to encrypt data on the fly before persisting via a JSON store.
*/
app.dao.DeviceStorage = function(util, crypto, jsonDao, sqlcipherDao) {
'use strict';
/**
* Stores a list of encrypted items in the object store
@ -65,5 +63,3 @@
};
};
}());

View File

@ -1,11 +1,9 @@
(function() {
'use strict';
/**
* A high-level Data-Access Api for handling Email synchronization
* between the cloud service and the device's local storage
*/
app.dao.EmailDAO = function(_, crypto, devicestorage, cloudstorage) {
'use strict';
/**
* Inits all dependencies
@ -117,5 +115,3 @@
};
};
}());

View File

@ -1,10 +1,8 @@
(function() {
'use strict';
/**
* Handles generic caching of JSON objects in a lawnchair adapter
*/
app.dao.LawnchairDAO = function(window) {
'use strict';
var db = new Lawnchair({
name: 'data-store'
@ -115,5 +113,3 @@
};
};
}());

View File

@ -1,10 +1,8 @@
(function() {
'use strict';
/**
* Handles generic caching of JSON objects in LocalStorage
*/
app.dao.LocalStorageDAO = function(window) {
'use strict';
/**
* Stringifies an object literal to JSON and perists it
@ -55,5 +53,3 @@
};
};
}());