wok-undigest rev 688

Up zerobin (0.13_alpha)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Apr 19 08:11:22 2012 +0200 (2012-04-19)
parents 7a644e6e7b18
children a6af485e996d
files zerobin/receipt zerobin/stuff/zerobin.u
line diff
     1.1 --- a/zerobin/receipt	Wed Apr 18 17:48:33 2012 +0200
     1.2 +++ b/zerobin/receipt	Thu Apr 19 08:11:22 2012 +0200
     1.3 @@ -1,7 +1,7 @@
     1.4  # SliTaz package receipt.
     1.5  
     1.6  PACKAGE="zerobin"
     1.7 -VERSION="0.12_alpha"
     1.8 +VERSION="0.13_alpha"
     1.9  CATEGORY="network"
    1.10  SHORT_DESC="Online pastebin where the server has zero knowledge of pasted data."
    1.11  MAINTAINER="pascal.bellard@slitaz.org"
    1.12 @@ -9,7 +9,7 @@
    1.13  WEB_SITE="http://sebsauvage.net/wiki/doku.php?id=php:zerobin"
    1.14  WGET_URL="http://sebsauvage.net/files/$TARBALL"
    1.15  
    1.16 -DEPENDS="php"
    1.17 +DEPENDS="php-gd"
    1.18  
    1.19  # Rules to configure and make the package.
    1.20  compile_rules()
     2.1 --- a/zerobin/stuff/zerobin.u	Wed Apr 18 17:48:33 2012 +0200
     2.2 +++ b/zerobin/stuff/zerobin.u	Thu Apr 19 08:11:22 2012 +0200
     2.3 @@ -1,19 +1,15 @@
     2.4  --- lib/zerobin.js
     2.5  +++ lib/zerobin.js
     2.6 -@@ -24,10 +24,12 @@
     2.7 - */
     2.8 - function randomCipher(message)
     2.9 +@@ -175,7 +175,11 @@
    2.10   {
    2.11 --    // Generate a random 256 bits key, encoded in base64:
    2.12 +     if ($('textarea#message').val().length==0) return; // Do not send if no data.
    2.13 +     showStatus('Sending paste...',spin=true); 
    2.14  -    var randomkey = sjcl.codec.base64.fromBits(sjcl.random.randomWords(8,0),0);
    2.15 --    // Then encrypt the compressed message with this key.
    2.16 --    var data = sjcl.encrypt(randomkey,compress(message));
    2.17  +    var randomkey = (window.location.hash.length > 2) ?
    2.18  +    	// force key
    2.19  +    	window.location.hash.substring(1) :
    2.20  +    	// Generate a random 256 bits key, encoded in base64:
    2.21  +    	sjcl.codec.base64.fromBits(sjcl.random.randomWords(8,0),0);
    2.22 -+    var	data = sjcl.encrypt(randomkey,compress(message));
    2.23 -     return {'data':data,'key':randomkey};
    2.24 - }
    2.25 - 
    2.26 +     var cipherdata = zeroCipher(randomkey,$('textarea#message').val());
    2.27 +     var data_to_send =  { data:cipherdata,
    2.28 +                           expire:$('select#pasteExpiration').val(),