Browse Source

Check padded length

Bob Mottram 8 years ago
parent
commit
45a8e47395
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      src/freedombone-pass

+ 4
- 1
src/freedombone-pass View File

109
 function run_tests {
109
 function run_tests {
110
     pass="SuperSecretPassword"
110
     pass="SuperSecretPassword"
111
     padded=$(pad_string "$pass")
111
     padded=$(pad_string "$pass")
112
-    echo "|${padded}|"
112
+    if [ ${#padded} -ne 128 ]; then
113
+        echo $'Incorrect padded length'
114
+        exit 78352
115
+    fi
113
     ${PROJECT_NAME}-pass -u root -a tests -p "$pass"
116
     ${PROJECT_NAME}-pass -u root -a tests -p "$pass"
114
     returned_pass=$(${PROJECT_NAME}-pass -u root -a tests)
117
     returned_pass=$(${PROJECT_NAME}-pass -u root -a tests)
115
     if [[ "$pass" != "$returned_pass" ]]; then
118
     if [[ "$pass" != "$returned_pass" ]]; then