added Makefile to install client deps

new-idea
Avril 4 years ago
parent 6265a8f41d
commit cd8973f45e
Signed by: flanchan
GPG Key ID: 284488987C31F630

5
.gitignore vendored

@ -1,4 +1,5 @@
/target /target
*~ *~
bower_components bower_components/
node_modules node_modules/
vendor/

@ -0,0 +1,10 @@
.PHONY: all
all: client
dirs:
@mkdir -p vendor
client: dirs
npm install
bower install crypto-js
cd node_modules/node-rsa/src && browserify -r ./NodeRSA.js:node-rsa > ../../../vendor/NodeRSA.js

@ -2,9 +2,9 @@ use super::*;
use cryptohelpers::sha256::Sha256Hash; use cryptohelpers::sha256::Sha256Hash;
use hard_format::formats::{ use hard_format::formats::{
PEMFormattedString,
PEMFormattedStr,
MaxLenString, MaxLenString,
Base64FormattedString,
Base64FormattedStr,
self, self,
}; };
use tripcode::Tripcode; use tripcode::Tripcode;
@ -46,14 +46,14 @@ pub struct Post
/// The client-side generated AES key used for decrypting the body's text. /// The client-side generated AES key used for decrypting the body's text.
/// ///
/// This AES key can be encrypted with any number of RSA public keys on the client side. There must be at least one, or the post body is lost. /// This AES key can be encrypted with any number of RSA public keys on the client side. There must be at least one, or the post body is lost and the post should be removed.
body_aes_keys: Vec<PostBodyString>, body_aes_keys: Vec<PostBodyString>,
/// The client-side encrypted body string /// The client-side encrypted body string
body: PostBodyString, body: PostBodyString,
/// Signature of the body (optional). /// Signature of the body (optional).
signature: Option<PEMFormattedString>, signature: Option<Base64FormattedString>,
/// Hash of the body /// Hash of the body
hash: Sha256Hash, hash: Sha256Hash,
@ -165,7 +165,7 @@ impl Post
} }
/// The PEM formatted signature of this post, if there is one. /// The PEM formatted signature of this post, if there is one.
pub fn signature(&self) -> Option<&PEMFormattedStr> pub fn signature(&self) -> Option<&Base64FormattedStr>
{ {
self.signature.as_ref().map(|x| x.as_ref()) self.signature.as_ref().map(|x| x.as_ref())
} }

File diff suppressed because it is too large Load Diff

@ -0,0 +1 @@
../../vendor/NodeRSA.js
Loading…
Cancel
Save