]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/streams/crypto/class_McryptStream.php
Added debug line.
[core.git] / inc / classes / main / streams / crypto / class_McryptStream.php
index bb6a89d783c0613f5ad820f4ca775a883a11199b..2a60fe235a0f82dc3c53bef41d083bd2537886fb 100644 (file)
@@ -2,11 +2,11 @@
 /**
  * A mcrypt-based encryption stream
  *
- * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
+ * @link               http://www.shipsimu.org
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -62,6 +62,9 @@ class McryptStream extends BaseStream implements EncryptableStream {
         * @return      $encrypted      Encrypted string
         */
        public function encryptStream ($str, $key = NULL) {
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: key[' . gettype($key) . ']=' . $key);
+
                // Init crypto module
                $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
                $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
@@ -163,7 +166,7 @@ class McryptStream extends BaseStream implements EncryptableStream {
         * @throws      UnsupportedOperationException   If this method is called (which is a mistake)
         */
        public function streamData ($data) {
-               $this->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.');
+               self::createDebugInstance(__CLASS__)->debugOutput('Unhandled ' . strlen($data) . ' bytes in this stream.');
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 }