Skip to content
This repository has been archived by the owner on Mar 16, 2023. It is now read-only.

Commit

Permalink
added length check to local decryption as has been done for local enc…
Browse files Browse the repository at this point in the history
…ryption
  • Loading branch information
yahesh committed Nov 8, 2019
1 parent 3143e37 commit 2352019
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.21b1 (2019-11-08)

* added length check to local decryption as has been done for local encryption

# 0.21b0 (2019-11-07)

* introduced `router.php` for local debugging
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

# Shared-Secrets v0.21b0
# Shared-Secrets v0.21b1
#
# Copyright (c) 2016-2019, SysEleven GmbH
# All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion pages/read/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<link href="/resources/css/read.css?<?= $cache_value ?>" integrity="sha256-wgpxEGDMqG2EJxicZqc40OJMPwN8rBAZTYLdGyagQGw=" rel="stylesheet" type="text/css" />

<script src="/resources/js/lib.js?<?= $cache_value ?>" integrity="sha256-d6lWbau1r7bB+u7utpkOX6tLTXnbOPqD33NmIXHY19A=" type="text/javascript"></script>
<script src="/resources/js/read.js?<?= $cache_value ?>" integrity="sha256-BqgJySPsN6oROEdrmoXeZhxiy3cWbYNZVvhFqYi5B5E=" type="text/javascript"></script>
<script src="/resources/js/read.js?<?= $cache_value ?>" integrity="sha256-0dlCa+2uL8Tgjq7VlZtajGikqq5BptgpEkQTc0xl1vU=" type="text/javascript"></script>
<script src="/resources/js/norepost.js?<?= $cache_value ?>" integrity="sha256-SdShL5XtGY7DRT4OatFFRS1b3QdADS22I8eEP1GA/As=" type="text/javascript"></script>

<?php
Expand Down
2 changes: 1 addition & 1 deletion pages/share/get.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<link href="/resources/css/share.css?<?= $cache_value ?>" integrity="sha256-EYu1Dc10IDi0yUOyV55YWmCKWfVlBj1rTMk/AsbViKE=" rel="stylesheet" type="text/css" />

<script src="/resources/js/lib.js?<?= $cache_value ?>" integrity="sha256-d6lWbau1r7bB+u7utpkOX6tLTXnbOPqD33NmIXHY19A=" type="text/javascript"></script>
<script src="/resources/js/share.js?<?= $cache_value ?>" integrity="sha256-jVvsQvz1rwhbs7Ddpihie31jsn/9byFRLI88NnGXzGM=" type="text/javascript"></script>
<script src="/resources/js/share.js?<?= $cache_value ?>" integrity="sha256-sNJqhCLJH7s32SPq0o7P9LJAtxTUhvAOT1CBzfZLbac=" type="text/javascript"></script>

<?php

Expand Down
10 changes: 8 additions & 2 deletions resources/js/read.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@

// action happening on local decryption
async function decrypt() {
var result = await decrypt_v00(document.getElementById("secret").innerHTML,
document.getElementById("password").value);
var result = null;

// check the length of the input
if ((0 < document.getElementById("secret").innerHTML.length) &&
(0 < document.getElementById("password").value.length)) {
result = await decrypt_v00(document.getElementById("secret").innerHTML,
document.getElementById("password").value);
}

if (null != result) {
document.getElementById("secret").innerHTML = html_entities(result);
Expand Down
1 change: 0 additions & 1 deletion resources/js/share.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

// action happening on local encryption
async function encrypt() {

var result = null;

// check the length of the input
Expand Down

0 comments on commit 2352019

Please sign in to comment.