@@ 74-83 (lines=10) @@ | ||
71 | $this->pushString($str, self::EOS); |
|
72 | } |
|
73 | ||
74 | switch ($encode) { |
|
75 | case 'encrypt': |
|
76 | $str = $this->encrypt($str, $method, $password, '', $throw); |
|
77 | break; |
|
78 | case 'hmac': |
|
79 | $str = $this->hmac($str, $method, $password, 0, $throw); |
|
80 | break; |
|
81 | default: |
|
82 | return $this->exception($throw, "Invalid method $encode.", 500); |
|
83 | } |
|
84 | // Return on error. |
|
85 | if (!$str) { |
|
86 | return null; |
|
@@ 138-147 (lines=10) @@ | ||
135 | ||
136 | list(, $decode, $method, $decodeFirst) = $supported; |
|
137 | ||
138 | switch ($decode) { |
|
139 | case 'decrypt': |
|
140 | $wstr = $this->decrypt($wstr, $method, $password, $throw); |
|
141 | break; |
|
142 | case 'verifyHmac': |
|
143 | $wstr = $this->verifyHmac($wstr, $method, $password, $throw); |
|
144 | break; |
|
145 | default: |
|
146 | return $this->exception($throw, "Invalid method $decode.", 500); |
|
147 | } |
|
148 | ||
149 | if ($wstr === null) { |
|
150 | return null; |