Skip to content

Commit

Permalink
add MIT paper, readme
Browse files Browse the repository at this point in the history
  • Loading branch information
strikeout committed Sep 21, 2014
1 parent 49aefcf commit e4b65f0
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 22 deletions.
39 changes: 19 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,17 @@ Luckily this is easy with the new package system.
// to your meteor project's packages folder
// copy
cp -R packages/* /pathto/your/project/packages/
cp -R packages/* /your/project/packages/
// link
ln -s ../../packages/accounts-base/ accounts-base
ln -s ../../packages/accounts-idp/ accounts-idp
ln -s ../../packages/accounts-password/ accounts-password
ln -s ../../packages/active-attacker/ active-attacker
ln -s ../../packages/async/ async
ln -s ../../packages/basic-crypto/ basic-crypto
ln -s ../../packages/ddp/ ddp
ln -s ../../packages/mongo/ mongo
ln -s ../../packages/principal/ principal
ln -s ../../packages/search/ search
ln -s ../../packages/timing/ timing
find packages/* -type d -maxdepth 0 -mindepth 0 -exec ln -s '{}' /your/project/packages/ \;
````


Look at the /example_EncChat for how to get started with collection declarations.

model.js (client & server)
example_EncChat/model.js (client & server)
````
//
Messages._encrypted_fields({
Expand All @@ -73,18 +63,27 @@ model.js (client & server)
});
Messages._immutable({roomprinc: ['rID', 'roomTitle', '_id']});
````

/server/init.js (server only)
important for the IDP, we need to publish explicitly the _wrapped_pk fields of the user doc (for now)
````
// important for the IDP, so it get the _wrapped_pk fields of the user doc
Meteor.publish("users", function () {
return Meteor.users.find(this.userId, {fields: {}});
});
Meteor.startup(function () {
// pub
if (Meteor.isServer) {
Meteor.publish("users", function () {
return Meteor.users.find(this.userId, {fields: {}});
});
}
// sub
if (Meteor.isClient) {
Tracker.autorun(function () {
Meteor.subscribe("users");
})
}
})
````



Then go to /docs and also check out /enc_modules for (partially outdated) implementation details.


Expand Down
Binary file added docs/MIT_Mylar.pdf
Binary file not shown.
17 changes: 17 additions & 0 deletions example_EncChat/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,23 @@ Messages._encrypted_fields({
Messages._immutable({roomprinc: ['rID', 'roomTitle', '_id']});


// important for the IDP, so it get the _wrapped_pk fields of the user doc
Meteor.startup(function () {
// pub
if (Meteor.isServer) {
Meteor.publish("users", function () {
return Meteor.users.find(this.userId, {fields: {}});
});
}
// sub
if (Meteor.isClient) {
Tracker.autorun(function () {
Meteor.subscribe("users");
})
}
})


/* trusted IDP: */
//var idp_pub = '8a7fe03431b5fc2db3923a2ab6d1a5ddf35cd64aea35e743' +
// 'ded7655f0dc7e085858eeec06e1c7da58c509d57da56dbe6';
Expand Down
3 changes: 1 addition & 2 deletions packages/principal/principal.js
Original file line number Diff line number Diff line change
Expand Up @@ -860,8 +860,7 @@ if (Meteor.isClient) {
var cert = data[0];
var attr = data[1];

var pk = crypto.deserialize_public(EJSON.parse(cert.signer).verify,
"ecdsa");
var pk = crypto.deserialize_public(EJSON.parse(cert.signer).verify, "ecdsa");
var subject = new Principal(attr.type, attr.name, subj_keys);
var msg = Certificate.contents(subject);
// Load up subject keys for the next cert
Expand Down

0 comments on commit e4b65f0

Please sign in to comment.