< prev index next >

src/jdk.crypto.ucrypto/solaris/native/libj2ucrypto/nativeCrypto.c

Print this page




  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #include <stdlib.h>
  27 #include <string.h>
  28 #include <strings.h>
  29 #include <jni.h>
  30 #include "jni_util.h"
  31 #include "nativeCrypto.h"
  32 #include "nativeFunc.h"







  33 
  34 /*
  35  * Dumps out byte array in hex with and name and length info
  36  */
  37 void printError(char* header, int mech, int rv) {
  38   if (mech != -1) {
  39     printf("%s, mech = %d, rv = 0x%0x\n", header, mech, rv);
  40   } else {
  41     printf("%s, rv = 0x%0x\n", header, rv);
  42   }
  43   if (*ftab->ucryptoStrerror != NULL) {
  44     char * reason = (*ftab->ucryptoStrerror)(rv);
  45     printf("\tcause = %s\n", reason);
  46     free(reason);
  47   }
  48 }
  49 
  50 /*
  51  * Dumps out byte array in hex with and name and length info
  52  */




  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #include <stdlib.h>
  27 #include <string.h>
  28 #include <strings.h>
  29 #include <jni.h>
  30 #include "jni_util.h"
  31 #include "nativeCrypto.h"
  32 #include "nativeFunc.h"
  33 #include "com_oracle_security_ucrypto_NativeCipher.h"
  34 #include "com_oracle_security_ucrypto_NativeDigest.h"
  35 #include "com_oracle_security_ucrypto_NativeKey.h"
  36 #include "com_oracle_security_ucrypto_NativeKey.h"
  37 #include "com_oracle_security_ucrypto_NativeRSACipher.h"
  38 #include "com_oracle_security_ucrypto_NativeRSASignature.h"
  39 #include "com_oracle_security_ucrypto_UcryptoProvider.h"
  40 
  41 /*
  42  * Dumps out byte array in hex with and name and length info
  43  */
  44 void printError(char* header, int mech, int rv) {
  45   if (mech != -1) {
  46     printf("%s, mech = %d, rv = 0x%0x\n", header, mech, rv);
  47   } else {
  48     printf("%s, rv = 0x%0x\n", header, rv);
  49   }
  50   if (*ftab->ucryptoStrerror != NULL) {
  51     char * reason = (*ftab->ucryptoStrerror)(rv);
  52     printf("\tcause = %s\n", reason);
  53     free(reason);
  54   }
  55 }
  56 
  57 /*
  58  * Dumps out byte array in hex with and name and length info
  59  */


< prev index next >