Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
776ce47e
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
776ce47e
编写于
11月 07, 2012
作者:
J
jzavgren
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8001579: Cleanup warnings in security native code
Reviewed-by: chegar, alanb, vinnie
上级
c35ebc1a
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
100 addition
and
90 deletion
+100
-90
src/share/native/sun/security/jgss/wrapper/GSSLibStub.c
src/share/native/sun/security/jgss/wrapper/GSSLibStub.c
+68
-67
src/share/native/sun/security/jgss/wrapper/NativeUtil.c
src/share/native/sun/security/jgss/wrapper/NativeUtil.c
+3
-2
src/share/native/sun/security/pkcs11/wrapper/p11_convert.c
src/share/native/sun/security/pkcs11/wrapper/p11_convert.c
+4
-0
src/share/native/sun/security/pkcs11/wrapper/p11_crypt.c
src/share/native/sun/security/pkcs11/wrapper/p11_crypt.c
+6
-6
src/share/native/sun/security/pkcs11/wrapper/p11_digest.c
src/share/native/sun/security/pkcs11/wrapper/p11_digest.c
+2
-1
src/share/native/sun/security/pkcs11/wrapper/p11_general.c
src/share/native/sun/security/pkcs11/wrapper/p11_general.c
+6
-4
src/share/native/sun/security/pkcs11/wrapper/p11_sessmgmt.c
src/share/native/sun/security/pkcs11/wrapper/p11_sessmgmt.c
+1
-1
src/share/native/sun/security/pkcs11/wrapper/p11_sign.c
src/share/native/sun/security/pkcs11/wrapper/p11_sign.c
+4
-3
src/share/native/sun/security/pkcs11/wrapper/p11_util.c
src/share/native/sun/security/pkcs11/wrapper/p11_util.c
+2
-2
src/solaris/native/sun/security/pkcs11/j2secmod_md.c
src/solaris/native/sun/security/pkcs11/j2secmod_md.c
+3
-3
src/solaris/native/sun/security/pkcs11/wrapper/p11_md.c
src/solaris/native/sun/security/pkcs11/wrapper/p11_md.c
+1
-1
未找到文件。
src/share/native/sun/security/jgss/wrapper/GSSLibStub.c
浏览文件 @
776ce47e
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include "sun_security_jgss_wrapper_GSSLibStub.h"
#include "sun_security_jgss_wrapper_GSSLibStub.h"
#include "NativeUtil.h"
#include "NativeUtil.h"
#include "NativeFunc.h"
#include "NativeFunc.h"
#include "jlong.h"
/* Constants for indicating what type of info is needed for inqueries */
/* Constants for indicating what type of info is needed for inqueries */
const
int
TYPE_CRED_NAME
=
10
;
const
int
TYPE_CRED_NAME
=
10
;
...
@@ -75,14 +76,14 @@ Java_sun_security_jgss_wrapper_GSSLibStub_getMechPtr(JNIEnv *env,
...
@@ -75,14 +76,14 @@ Java_sun_security_jgss_wrapper_GSSLibStub_getMechPtr(JNIEnv *env,
jclass
jcls
,
jclass
jcls
,
jbyteArray
jbytes
)
{
jbyteArray
jbytes
)
{
gss_OID
cOid
;
gss_OID
cOid
;
int
i
,
len
;
unsigned
int
i
,
len
;
jbyte
*
bytes
;
jbyte
*
bytes
;
jthrowable
gssEx
;
jthrowable
gssEx
;
jboolean
found
;
jboolean
found
;
if
(
jbytes
!=
NULL
)
{
if
(
jbytes
!=
NULL
)
{
found
=
JNI_FALSE
;
found
=
JNI_FALSE
;
len
=
(
*
env
)
->
GetArrayLength
(
env
,
jbytes
)
-
2
;
len
=
(
unsigned
int
)((
*
env
)
->
GetArrayLength
(
env
,
jbytes
)
-
2
)
;
bytes
=
(
*
env
)
->
GetByteArrayElements
(
env
,
jbytes
,
NULL
);
bytes
=
(
*
env
)
->
GetByteArrayElements
(
env
,
jbytes
,
NULL
);
if
(
bytes
!=
NULL
)
{
if
(
bytes
!=
NULL
)
{
for
(
i
=
0
;
i
<
ftab
->
mechs
->
count
;
i
++
)
{
for
(
i
=
0
;
i
<
ftab
->
mechs
->
count
;
i
++
)
{
...
@@ -98,9 +99,9 @@ Java_sun_security_jgss_wrapper_GSSLibStub_getMechPtr(JNIEnv *env,
...
@@ -98,9 +99,9 @@ Java_sun_security_jgss_wrapper_GSSLibStub_getMechPtr(JNIEnv *env,
}
}
if
(
found
!=
JNI_TRUE
)
{
if
(
found
!=
JNI_TRUE
)
{
checkStatus
(
env
,
NULL
,
GSS_S_BAD_MECH
,
0
,
"[GSSLibStub_getMechPtr]"
);
checkStatus
(
env
,
NULL
,
GSS_S_BAD_MECH
,
0
,
"[GSSLibStub_getMechPtr]"
);
return
NULL
;
return
ptr_to_jlong
(
NULL
)
;
}
else
return
cOid
;
}
else
return
ptr_to_jlong
(
cOid
)
;
}
else
return
GSS_C_NO_OID
;
}
else
return
ptr_to_jlong
(
GSS_C_NO_OID
)
;
}
}
...
@@ -244,7 +245,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_inquireNamesForMech(JNIEnv *env,
...
@@ -244,7 +245,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_inquireNamesForMech(JNIEnv *env,
if
(
ftab
->
inquireNamesForMech
!=
NULL
)
{
if
(
ftab
->
inquireNamesForMech
!=
NULL
)
{
mech
=
(
gss_OID
)
(
*
env
)
->
GetLongField
(
env
,
jobj
,
FID_GSSLibStub_pMech
);
mech
=
(
gss_OID
)
jlong_to_ptr
((
*
env
)
->
GetLongField
(
env
,
jobj
,
FID_GSSLibStub_pMech
)
);
nameTypes
=
GSS_C_NO_OID_SET
;
nameTypes
=
GSS_C_NO_OID_SET
;
/* gss_inquire_names_for_mech(...) => N/A */
/* gss_inquire_names_for_mech(...) => N/A */
...
@@ -273,7 +274,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_releaseName(JNIEnv *env,
...
@@ -273,7 +274,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_releaseName(JNIEnv *env,
OM_uint32
minor
,
major
;
OM_uint32
minor
,
major
;
gss_name_t
nameHdl
;
gss_name_t
nameHdl
;
nameHdl
=
(
gss_name_t
)
pName
;
nameHdl
=
(
gss_name_t
)
jlong_to_ptr
(
pName
)
;
sprintf
(
debugBuf
,
"[GSSLibStub_releaseName] %ld"
,
(
long
)
pName
);
sprintf
(
debugBuf
,
"[GSSLibStub_releaseName] %ld"
,
(
long
)
pName
);
debug
(
env
,
debugBuf
);
debug
(
env
,
debugBuf
);
...
@@ -319,7 +320,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_importName(JNIEnv *env,
...
@@ -319,7 +320,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_importName(JNIEnv *env,
resetGSSBuffer
(
env
,
jnameVal
,
&
nameVal
);
resetGSSBuffer
(
env
,
jnameVal
,
&
nameVal
);
checkStatus
(
env
,
jobj
,
major
,
minor
,
"[GSSLibStub_importName]"
);
checkStatus
(
env
,
jobj
,
major
,
minor
,
"[GSSLibStub_importName]"
);
return
(
jlong
)
nameHdl
;
return
ptr_to_jlong
(
nameHdl
)
;
}
}
...
@@ -339,8 +340,8 @@ Java_sun_security_jgss_wrapper_GSSLibStub_compareName(JNIEnv *env,
...
@@ -339,8 +340,8 @@ Java_sun_security_jgss_wrapper_GSSLibStub_compareName(JNIEnv *env,
int
isEqual
;
int
isEqual
;
isEqual
=
0
;
isEqual
=
0
;
nameHdl1
=
(
gss_name_t
)
pName1
;
nameHdl1
=
(
gss_name_t
)
jlong_to_ptr
(
pName1
)
;
nameHdl2
=
(
gss_name_t
)
pName2
;
nameHdl2
=
(
gss_name_t
)
jlong_to_ptr
(
pName2
)
;
sprintf
(
debugBuf
,
"[GSSLibStub_compareName] %ld %ld"
,
(
long
)
pName1
,
sprintf
(
debugBuf
,
"[GSSLibStub_compareName] %ld %ld"
,
(
long
)
pName1
,
(
long
)
pName2
);
(
long
)
pName2
);
...
@@ -370,12 +371,12 @@ Java_sun_security_jgss_wrapper_GSSLibStub_canonicalizeName(JNIEnv *env,
...
@@ -370,12 +371,12 @@ Java_sun_security_jgss_wrapper_GSSLibStub_canonicalizeName(JNIEnv *env,
gss_name_t
nameHdl
,
mnNameHdl
;
gss_name_t
nameHdl
,
mnNameHdl
;
gss_OID
mech
;
gss_OID
mech
;
nameHdl
=
(
gss_name_t
)
pName
;
nameHdl
=
(
gss_name_t
)
jlong_to_ptr
(
pName
)
;
sprintf
(
debugBuf
,
"[GSSLibStub_canonicalizeName] %ld"
,
(
long
)
pName
);
sprintf
(
debugBuf
,
"[GSSLibStub_canonicalizeName] %ld"
,
(
long
)
pName
);
debug
(
env
,
debugBuf
);
debug
(
env
,
debugBuf
);
if
(
nameHdl
!=
GSS_C_NO_NAME
)
{
if
(
nameHdl
!=
GSS_C_NO_NAME
)
{
mech
=
(
gss_OID
)
(
*
env
)
->
GetLongField
(
env
,
jobj
,
FID_GSSLibStub_pMech
);
mech
=
(
gss_OID
)
jlong_to_ptr
((
*
env
)
->
GetLongField
(
env
,
jobj
,
FID_GSSLibStub_pMech
)
);
mnNameHdl
=
GSS_C_NO_NAME
;
mnNameHdl
=
GSS_C_NO_NAME
;
/* gss_canonicalize_name(...) may return GSS_S_BAD_NAMETYPE,
/* gss_canonicalize_name(...) may return GSS_S_BAD_NAMETYPE,
...
@@ -391,7 +392,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_canonicalizeName(JNIEnv *env,
...
@@ -391,7 +392,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_canonicalizeName(JNIEnv *env,
checkStatus
(
env
,
jobj
,
major
,
minor
,
"[GSSLibStub_canonicalizeName]"
);
checkStatus
(
env
,
jobj
,
major
,
minor
,
"[GSSLibStub_canonicalizeName]"
);
}
else
mnNameHdl
=
GSS_C_NO_NAME
;
}
else
mnNameHdl
=
GSS_C_NO_NAME
;
return
(
jlong
)
mnNameHdl
;
return
ptr_to_jlong
(
mnNameHdl
)
;
}
}
/*
/*
...
@@ -408,7 +409,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_exportName(JNIEnv *env,
...
@@ -408,7 +409,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_exportName(JNIEnv *env,
gss_buffer_desc
outBuf
;
gss_buffer_desc
outBuf
;
jbyteArray
jresult
;
jbyteArray
jresult
;
nameHdl
=
(
gss_name_t
)
pName
;
nameHdl
=
(
gss_name_t
)
jlong_to_ptr
(
pName
)
;
sprintf
(
debugBuf
,
"[GSSLibStub_exportName] %ld"
,
(
long
)
pName
);
sprintf
(
debugBuf
,
"[GSSLibStub_exportName] %ld"
,
(
long
)
pName
);
debug
(
env
,
debugBuf
);
debug
(
env
,
debugBuf
);
...
@@ -420,16 +421,16 @@ Java_sun_security_jgss_wrapper_GSSLibStub_exportName(JNIEnv *env,
...
@@ -420,16 +421,16 @@ Java_sun_security_jgss_wrapper_GSSLibStub_exportName(JNIEnv *env,
if
(
major
==
GSS_S_NAME_NOT_MN
)
{
if
(
major
==
GSS_S_NAME_NOT_MN
)
{
debug
(
env
,
"[GSSLibStub_exportName] canonicalize and re-try"
);
debug
(
env
,
"[GSSLibStub_exportName] canonicalize and re-try"
);
mNameHdl
=
(
gss_name_t
)
mNameHdl
=
(
gss_name_t
)
jlong_to_ptr
(
Java_sun_security_jgss_wrapper_GSSLibStub_canonicalizeName
Java_sun_security_jgss_wrapper_GSSLibStub_canonicalizeName
(
env
,
jobj
,
pName
);
(
env
,
jobj
,
pName
)
)
;
/* return immediately if an exception has occurred */
/* return immediately if an exception has occurred */
if
((
*
env
)
->
ExceptionCheck
(
env
))
{
if
((
*
env
)
->
ExceptionCheck
(
env
))
{
return
NULL
;
return
NULL
;
}
}
major
=
(
*
ftab
->
exportName
)(
&
minor
,
mNameHdl
,
&
outBuf
);
major
=
(
*
ftab
->
exportName
)(
&
minor
,
mNameHdl
,
&
outBuf
);
Java_sun_security_jgss_wrapper_GSSLibStub_releaseName
Java_sun_security_jgss_wrapper_GSSLibStub_releaseName
(
env
,
jobj
,
(
jlong
)
mNameHdl
);
(
env
,
jobj
,
ptr_to_jlong
(
mNameHdl
)
);
/* return immediately if an exception has occurred */
/* return immediately if an exception has occurred */
if
((
*
env
)
->
ExceptionCheck
(
env
))
{
if
((
*
env
)
->
ExceptionCheck
(
env
))
{
return
NULL
;
return
NULL
;
...
@@ -460,7 +461,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_displayName(JNIEnv *env,
...
@@ -460,7 +461,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_displayName(JNIEnv *env,
jobject
jtype
;
jobject
jtype
;
jobjectArray
jresult
;
jobjectArray
jresult
;
nameHdl
=
(
gss_name_t
)
pName
;
nameHdl
=
(
gss_name_t
)
jlong_to_ptr
(
pName
)
;
sprintf
(
debugBuf
,
"[GSSLibStub_displayName] %ld"
,
(
long
)
pName
);
sprintf
(
debugBuf
,
"[GSSLibStub_displayName] %ld"
,
(
long
)
pName
);
debug
(
env
,
debugBuf
);
debug
(
env
,
debugBuf
);
...
@@ -512,10 +513,10 @@ Java_sun_security_jgss_wrapper_GSSLibStub_acquireCred(JNIEnv *env,
...
@@ -512,10 +513,10 @@ Java_sun_security_jgss_wrapper_GSSLibStub_acquireCred(JNIEnv *env,
debug
(
env
,
"[GSSLibStub_acquireCred]"
);
debug
(
env
,
"[GSSLibStub_acquireCred]"
);
mech
=
(
gss_OID
)
(
*
env
)
->
GetLongField
(
env
,
jobj
,
FID_GSSLibStub_pMech
);
mech
=
(
gss_OID
)
jlong_to_ptr
((
*
env
)
->
GetLongField
(
env
,
jobj
,
FID_GSSLibStub_pMech
)
);
mechs
=
newGSSOIDSet
(
env
,
mech
);
mechs
=
newGSSOIDSet
(
env
,
mech
);
credUsage
=
(
gss_cred_usage_t
)
usage
;
credUsage
=
(
gss_cred_usage_t
)
usage
;
nameHdl
=
(
gss_name_t
)
pName
;
nameHdl
=
(
gss_name_t
)
jlong_to_ptr
(
pName
)
;
credHdl
=
GSS_C_NO_CREDENTIAL
;
credHdl
=
GSS_C_NO_CREDENTIAL
;
sprintf
(
debugBuf
,
"[GSSLibStub_acquireCred] pName=%ld, usage=%d"
,
sprintf
(
debugBuf
,
"[GSSLibStub_acquireCred] pName=%ld, usage=%d"
,
...
@@ -534,7 +535,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_acquireCred(JNIEnv *env,
...
@@ -534,7 +535,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_acquireCred(JNIEnv *env,
debug
(
env
,
debugBuf
);
debug
(
env
,
debugBuf
);
checkStatus
(
env
,
jobj
,
major
,
minor
,
"[GSSLibStub_acquireCred]"
);
checkStatus
(
env
,
jobj
,
major
,
minor
,
"[GSSLibStub_acquireCred]"
);
return
(
jlong
)
credHdl
;
return
ptr_to_jlong
(
credHdl
)
;
}
}
/*
/*
...
@@ -550,9 +551,9 @@ Java_sun_security_jgss_wrapper_GSSLibStub_releaseCred(JNIEnv *env,
...
@@ -550,9 +551,9 @@ Java_sun_security_jgss_wrapper_GSSLibStub_releaseCred(JNIEnv *env,
OM_uint32
minor
,
major
;
OM_uint32
minor
,
major
;
gss_cred_id_t
credHdl
;
gss_cred_id_t
credHdl
;
credHdl
=
(
gss_cred_id_t
)
pCred
;
credHdl
=
(
gss_cred_id_t
)
jlong_to_ptr
(
pCred
)
;
sprintf
(
debugBuf
,
"[GSSLibStub_releaseCred] %ld"
,
pCred
);
sprintf
(
debugBuf
,
"[GSSLibStub_releaseCred] %ld"
,
(
long
int
)
pCred
);
debug
(
env
,
debugBuf
);
debug
(
env
,
debugBuf
);
if
(
credHdl
!=
GSS_C_NO_CREDENTIAL
)
{
if
(
credHdl
!=
GSS_C_NO_CREDENTIAL
)
{
...
@@ -562,7 +563,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_releaseCred(JNIEnv *env,
...
@@ -562,7 +563,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_releaseCred(JNIEnv *env,
checkStatus
(
env
,
jobj
,
major
,
minor
,
"[GSSLibStub_releaseCred]"
);
checkStatus
(
env
,
jobj
,
major
,
minor
,
"[GSSLibStub_releaseCred]"
);
}
}
return
(
jlong
)
credHdl
;
return
ptr_to_jlong
(
credHdl
)
;
}
}
/*
/*
...
@@ -570,7 +571,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_releaseCred(JNIEnv *env,
...
@@ -570,7 +571,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_releaseCred(JNIEnv *env,
*/
*/
void
inquireCred
(
JNIEnv
*
env
,
jobject
jobj
,
gss_cred_id_t
pCred
,
void
inquireCred
(
JNIEnv
*
env
,
jobject
jobj
,
gss_cred_id_t
pCred
,
jint
type
,
void
*
result
)
{
jint
type
,
void
*
result
)
{
OM_uint32
minor
,
major
;
OM_uint32
minor
,
major
=
GSS_C_QOP_DEFAULT
;
OM_uint32
routineErr
;
OM_uint32
routineErr
;
gss_cred_id_t
credHdl
;
gss_cred_id_t
credHdl
;
...
@@ -617,9 +618,9 @@ Java_sun_security_jgss_wrapper_GSSLibStub_getCredName(JNIEnv *env,
...
@@ -617,9 +618,9 @@ Java_sun_security_jgss_wrapper_GSSLibStub_getCredName(JNIEnv *env,
gss_name_t
nameHdl
;
gss_name_t
nameHdl
;
gss_cred_id_t
credHdl
;
gss_cred_id_t
credHdl
;
credHdl
=
(
gss_cred_id_t
)
pCred
;
credHdl
=
(
gss_cred_id_t
)
jlong_to_ptr
(
pCred
)
;
sprintf
(
debugBuf
,
"[GSSLibStub_getCredName] %ld"
,
pCred
);
sprintf
(
debugBuf
,
"[GSSLibStub_getCredName] %ld"
,
(
long
int
)
pCred
);
debug
(
env
,
debugBuf
);
debug
(
env
,
debugBuf
);
nameHdl
=
GSS_C_NO_NAME
;
nameHdl
=
GSS_C_NO_NAME
;
...
@@ -633,7 +634,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_getCredName(JNIEnv *env,
...
@@ -633,7 +634,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_getCredName(JNIEnv *env,
sprintf
(
debugBuf
,
"[GSSLibStub_getCredName] pName=%ld"
,
(
long
)
nameHdl
);
sprintf
(
debugBuf
,
"[GSSLibStub_getCredName] pName=%ld"
,
(
long
)
nameHdl
);
debug
(
env
,
debugBuf
);
debug
(
env
,
debugBuf
);
return
(
jlong
)
nameHdl
;
return
ptr_to_jlong
(
nameHdl
)
;
}
}
/*
/*
...
@@ -649,9 +650,9 @@ Java_sun_security_jgss_wrapper_GSSLibStub_getCredTime(JNIEnv *env,
...
@@ -649,9 +650,9 @@ Java_sun_security_jgss_wrapper_GSSLibStub_getCredTime(JNIEnv *env,
gss_cred_id_t
credHdl
;
gss_cred_id_t
credHdl
;
OM_uint32
lifetime
;
OM_uint32
lifetime
;
credHdl
=
(
gss_cred_id_t
)
pCred
;
credHdl
=
(
gss_cred_id_t
)
jlong_to_ptr
(
pCred
)
;
sprintf
(
debugBuf
,
"[GSSLibStub_getCredTime] %ld"
,
pCred
);
sprintf
(
debugBuf
,
"[GSSLibStub_getCredTime] %ld"
,
(
long
int
)
pCred
);
debug
(
env
,
debugBuf
);
debug
(
env
,
debugBuf
);
lifetime
=
0
;
lifetime
=
0
;
...
@@ -677,9 +678,9 @@ Java_sun_security_jgss_wrapper_GSSLibStub_getCredUsage(JNIEnv *env,
...
@@ -677,9 +678,9 @@ Java_sun_security_jgss_wrapper_GSSLibStub_getCredUsage(JNIEnv *env,
gss_cred_usage_t
usage
;
gss_cred_usage_t
usage
;
gss_cred_id_t
credHdl
;
gss_cred_id_t
credHdl
;
credHdl
=
(
gss_cred_id_t
)
pCred
;
credHdl
=
(
gss_cred_id_t
)
jlong_to_ptr
(
pCred
)
;
sprintf
(
debugBuf
,
"[GSSLibStub_getCredUsage] %ld"
,
pCred
);
sprintf
(
debugBuf
,
"[GSSLibStub_getCredUsage] %ld"
,
(
long
int
)
pCred
);
debug
(
env
,
debugBuf
);
debug
(
env
,
debugBuf
);
inquireCred
(
env
,
jobj
,
credHdl
,
TYPE_CRED_USAGE
,
&
usage
);
inquireCred
(
env
,
jobj
,
credHdl
,
TYPE_CRED_USAGE
,
&
usage
);
...
@@ -738,13 +739,13 @@ Java_sun_security_jgss_wrapper_GSSLibStub_importContext(JNIEnv *env,
...
@@ -738,13 +739,13 @@ Java_sun_security_jgss_wrapper_GSSLibStub_importContext(JNIEnv *env,
return
NULL
;
return
NULL
;
}
}
mech2
=
(
gss_OID
)
(
*
env
)
->
GetLongField
(
env
,
jobj
,
FID_GSSLibStub_pMech
);
mech2
=
(
gss_OID
)
jlong_to_ptr
((
*
env
)
->
GetLongField
(
env
,
jobj
,
FID_GSSLibStub_pMech
)
);
if
(
sameMech
(
env
,
mech
,
mech2
)
==
JNI_TRUE
)
{
if
(
sameMech
(
env
,
mech
,
mech2
)
==
JNI_TRUE
)
{
/* mech match - return the context object */
/* mech match - return the context object */
return
(
*
env
)
->
NewObject
(
env
,
CLS_NativeGSSContext
,
return
(
*
env
)
->
NewObject
(
env
,
CLS_NativeGSSContext
,
MID_NativeGSSContext_ctor
,
MID_NativeGSSContext_ctor
,
(
jlong
)
contextHdl
,
jobj
);
ptr_to_jlong
(
contextHdl
)
,
jobj
);
}
else
{
}
else
{
/* mech mismatch - clean up then return null */
/* mech mismatch - clean up then return null */
major
=
(
*
ftab
->
deleteSecContext
)(
&
minor
,
&
contextHdl
,
GSS_C_NO_BUFFER
);
major
=
(
*
ftab
->
deleteSecContext
)(
&
minor
,
&
contextHdl
,
GSS_C_NO_BUFFER
);
...
@@ -784,11 +785,11 @@ Java_sun_security_jgss_wrapper_GSSLibStub_initContext(JNIEnv *env,
...
@@ -784,11 +785,11 @@ Java_sun_security_jgss_wrapper_GSSLibStub_initContext(JNIEnv *env,
*/
*/
debug
(
env
,
"[GSSLibStub_initContext]"
);
debug
(
env
,
"[GSSLibStub_initContext]"
);
credHdl
=
(
gss_cred_id_t
)
pCred
;
credHdl
=
(
gss_cred_id_t
)
jlong_to_ptr
(
pCred
)
;
contextHdl
=
(
gss_ctx_id_t
)
contextHdl
=
(
gss_ctx_id_t
)
jlong_to_ptr
(
(
*
env
)
->
GetLongField
(
env
,
jcontextSpi
,
FID_NativeGSSContext_pContext
);
(
*
env
)
->
GetLongField
(
env
,
jcontextSpi
,
FID_NativeGSSContext_pContext
)
)
;
targetName
=
(
gss_name_t
)
pName
;
targetName
=
(
gss_name_t
)
jlong_to_ptr
(
pName
)
;
mech
=
(
gss_OID
)
(
*
env
)
->
GetLongField
(
env
,
jobj
,
FID_GSSLibStub_pMech
);
mech
=
(
gss_OID
)
jlong_to_ptr
((
*
env
)
->
GetLongField
(
env
,
jobj
,
FID_GSSLibStub_pMech
)
);
flags
=
(
OM_uint32
)
(
*
env
)
->
GetIntField
(
env
,
jcontextSpi
,
flags
=
(
OM_uint32
)
(
*
env
)
->
GetIntField
(
env
,
jcontextSpi
,
FID_NativeGSSContext_flags
);
FID_NativeGSSContext_flags
);
time
=
getGSSTime
((
*
env
)
->
GetIntField
(
env
,
jcontextSpi
,
time
=
getGSSTime
((
*
env
)
->
GetIntField
(
env
,
jcontextSpi
,
...
@@ -821,7 +822,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_initContext(JNIEnv *env,
...
@@ -821,7 +822,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_initContext(JNIEnv *env,
if
(
GSS_ERROR
(
major
)
==
GSS_S_COMPLETE
)
{
if
(
GSS_ERROR
(
major
)
==
GSS_S_COMPLETE
)
{
/* update member values if needed */
/* update member values if needed */
(
*
env
)
->
SetLongField
(
env
,
jcontextSpi
,
FID_NativeGSSContext_pContext
,
(
*
env
)
->
SetLongField
(
env
,
jcontextSpi
,
FID_NativeGSSContext_pContext
,
(
jlong
)
contextHdl
);
ptr_to_jlong
(
contextHdl
)
);
(
*
env
)
->
SetIntField
(
env
,
jcontextSpi
,
FID_NativeGSSContext_flags
,
aFlags
);
(
*
env
)
->
SetIntField
(
env
,
jcontextSpi
,
FID_NativeGSSContext_flags
,
aFlags
);
sprintf
(
debugBuf
,
"[GSSLibStub_initContext] set flags=0x%x"
,
aFlags
);
sprintf
(
debugBuf
,
"[GSSLibStub_initContext] set flags=0x%x"
,
aFlags
);
debug
(
env
,
debugBuf
);
debug
(
env
,
debugBuf
);
...
@@ -879,7 +880,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_acceptContext(JNIEnv *env,
...
@@ -879,7 +880,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_acceptContext(JNIEnv *env,
OM_uint32
aFlags
;
OM_uint32
aFlags
;
OM_uint32
aTime
;
OM_uint32
aTime
;
gss_cred_id_t
delCred
;
gss_cred_id_t
delCred
;
jobject
jsrcName
;
jobject
jsrcName
=
GSS_C_NO_NAME
;
jobject
jdelCred
;
jobject
jdelCred
;
jobject
jMech
;
jobject
jMech
;
jbyteArray
jresult
;
jbyteArray
jresult
;
...
@@ -889,9 +890,9 @@ Java_sun_security_jgss_wrapper_GSSLibStub_acceptContext(JNIEnv *env,
...
@@ -889,9 +890,9 @@ Java_sun_security_jgss_wrapper_GSSLibStub_acceptContext(JNIEnv *env,
debug
(
env
,
"[GSSLibStub_acceptContext]"
);
debug
(
env
,
"[GSSLibStub_acceptContext]"
);
contextHdl
=
(
gss_ctx_id_t
)
contextHdl
=
(
gss_ctx_id_t
)
jlong_to_ptr
(
(
*
env
)
->
GetLongField
(
env
,
jcontextSpi
,
FID_NativeGSSContext_pContext
);
(
*
env
)
->
GetLongField
(
env
,
jcontextSpi
,
FID_NativeGSSContext_pContext
)
)
;
credHdl
=
(
gss_cred_id_t
)
pCred
;
credHdl
=
(
gss_cred_id_t
)
jlong_to_ptr
(
pCred
)
;
initGSSBuffer
(
env
,
jinToken
,
&
inToken
);
initGSSBuffer
(
env
,
jinToken
,
&
inToken
);
cb
=
getGSSCB
(
env
,
jcb
);
cb
=
getGSSCB
(
env
,
jcb
);
srcName
=
GSS_C_NO_NAME
;
srcName
=
GSS_C_NO_NAME
;
...
@@ -922,7 +923,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_acceptContext(JNIEnv *env,
...
@@ -922,7 +923,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_acceptContext(JNIEnv *env,
if
(
GSS_ERROR
(
major
)
==
GSS_S_COMPLETE
)
{
if
(
GSS_ERROR
(
major
)
==
GSS_S_COMPLETE
)
{
/* update member values if needed */
/* update member values if needed */
(
*
env
)
->
SetLongField
(
env
,
jcontextSpi
,
FID_NativeGSSContext_pContext
,
(
*
env
)
->
SetLongField
(
env
,
jcontextSpi
,
FID_NativeGSSContext_pContext
,
(
jlong
)
contextHdl
);
ptr_to_jlong
(
contextHdl
)
);
sprintf
(
debugBuf
,
"[GSSLibStub_acceptContext] set pContext=%ld"
,
sprintf
(
debugBuf
,
"[GSSLibStub_acceptContext] set pContext=%ld"
,
(
long
)
contextHdl
);
(
long
)
contextHdl
);
debug
(
env
,
debugBuf
);
debug
(
env
,
debugBuf
);
...
@@ -940,7 +941,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_acceptContext(JNIEnv *env,
...
@@ -940,7 +941,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_acceptContext(JNIEnv *env,
NULL
,
NULL
);
NULL
,
NULL
);
jtargetName
=
(
*
env
)
->
NewObject
(
env
,
CLS_GSSNameElement
,
jtargetName
=
(
*
env
)
->
NewObject
(
env
,
CLS_GSSNameElement
,
MID_GSSNameElement_ctor
,
MID_GSSNameElement_ctor
,
(
jlong
)
targetName
,
jobj
);
ptr_to_jlong
(
targetName
)
,
jobj
);
/* return immediately if an exception has occurred */
/* return immediately if an exception has occurred */
if
((
*
env
)
->
ExceptionCheck
(
env
))
{
if
((
*
env
)
->
ExceptionCheck
(
env
))
{
...
@@ -955,7 +956,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_acceptContext(JNIEnv *env,
...
@@ -955,7 +956,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_acceptContext(JNIEnv *env,
if
(
srcName
!=
GSS_C_NO_NAME
)
{
if
(
srcName
!=
GSS_C_NO_NAME
)
{
jsrcName
=
(
*
env
)
->
NewObject
(
env
,
CLS_GSSNameElement
,
jsrcName
=
(
*
env
)
->
NewObject
(
env
,
CLS_GSSNameElement
,
MID_GSSNameElement_ctor
,
MID_GSSNameElement_ctor
,
(
jlong
)
srcName
,
jobj
);
ptr_to_jlong
(
srcName
)
,
jobj
);
/* return immediately if an exception has occurred */
/* return immediately if an exception has occurred */
if
((
*
env
)
->
ExceptionCheck
(
env
))
{
if
((
*
env
)
->
ExceptionCheck
(
env
))
{
return
NULL
;
return
NULL
;
...
@@ -981,7 +982,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_acceptContext(JNIEnv *env,
...
@@ -981,7 +982,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_acceptContext(JNIEnv *env,
if
(
delCred
!=
GSS_C_NO_CREDENTIAL
)
{
if
(
delCred
!=
GSS_C_NO_CREDENTIAL
)
{
jdelCred
=
(
*
env
)
->
NewObject
(
env
,
CLS_GSSCredElement
,
jdelCred
=
(
*
env
)
->
NewObject
(
env
,
CLS_GSSCredElement
,
MID_GSSCredElement_ctor
,
MID_GSSCredElement_ctor
,
(
jlong
)
delCred
,
jsrcName
,
jMech
);
ptr_to_jlong
(
delCred
)
,
jsrcName
,
jMech
);
/* return immediately if an exception has occurred */
/* return immediately if an exception has occurred */
if
((
*
env
)
->
ExceptionCheck
(
env
))
{
if
((
*
env
)
->
ExceptionCheck
(
env
))
{
return
NULL
;
return
NULL
;
...
@@ -1031,7 +1032,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_inquireContext(JNIEnv *env,
...
@@ -1031,7 +1032,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_inquireContext(JNIEnv *env,
jlong
result
[
6
];
jlong
result
[
6
];
jlongArray
jresult
;
jlongArray
jresult
;
contextHdl
=
(
gss_ctx_id_t
)
pContext
;
contextHdl
=
(
gss_ctx_id_t
)
jlong_to_ptr
(
pContext
)
;
sprintf
(
debugBuf
,
"[GSSLibStub_inquireContext] %ld"
,
(
long
)
contextHdl
);
sprintf
(
debugBuf
,
"[GSSLibStub_inquireContext] %ld"
,
(
long
)
contextHdl
);
debug
(
env
,
debugBuf
);
debug
(
env
,
debugBuf
);
...
@@ -1051,8 +1052,8 @@ Java_sun_security_jgss_wrapper_GSSLibStub_inquireContext(JNIEnv *env,
...
@@ -1051,8 +1052,8 @@ Java_sun_security_jgss_wrapper_GSSLibStub_inquireContext(JNIEnv *env,
(
long
)
targetName
);
(
long
)
targetName
);
debug
(
env
,
debugBuf
);
debug
(
env
,
debugBuf
);
result
[
0
]
=
(
jlong
)
srcName
;
result
[
0
]
=
ptr_to_jlong
(
srcName
)
;
result
[
1
]
=
(
jlong
)
targetName
;
result
[
1
]
=
ptr_to_jlong
(
targetName
)
;
result
[
2
]
=
(
jlong
)
isInitiator
;
result
[
2
]
=
(
jlong
)
isInitiator
;
result
[
3
]
=
(
jlong
)
isEstablished
;
result
[
3
]
=
(
jlong
)
isEstablished
;
result
[
4
]
=
(
jlong
)
flags
;
result
[
4
]
=
(
jlong
)
flags
;
...
@@ -1081,9 +1082,9 @@ Java_sun_security_jgss_wrapper_GSSLibStub_getContextMech(JNIEnv *env,
...
@@ -1081,9 +1082,9 @@ Java_sun_security_jgss_wrapper_GSSLibStub_getContextMech(JNIEnv *env,
gss_OID
mech
;
gss_OID
mech
;
gss_ctx_id_t
contextHdl
;
gss_ctx_id_t
contextHdl
;
contextHdl
=
(
gss_ctx_id_t
)
pContext
;
contextHdl
=
(
gss_ctx_id_t
)
jlong_to_ptr
(
pContext
)
;
sprintf
(
debugBuf
,
"[GSSLibStub_getContextMech] %ld"
,
pContext
);
sprintf
(
debugBuf
,
"[GSSLibStub_getContextMech] %ld"
,
(
long
int
)
pContext
);
debug
(
env
,
debugBuf
);
debug
(
env
,
debugBuf
);
major
=
(
*
ftab
->
inquireContext
)(
&
minor
,
contextHdl
,
NULL
,
NULL
,
major
=
(
*
ftab
->
inquireContext
)(
&
minor
,
contextHdl
,
NULL
,
NULL
,
...
@@ -1111,7 +1112,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_getContextName(JNIEnv *env,
...
@@ -1111,7 +1112,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_getContextName(JNIEnv *env,
gss_name_t
nameHdl
;
gss_name_t
nameHdl
;
gss_ctx_id_t
contextHdl
;
gss_ctx_id_t
contextHdl
;
contextHdl
=
(
gss_ctx_id_t
)
pContext
;
contextHdl
=
(
gss_ctx_id_t
)
jlong_to_ptr
(
pContext
)
;
sprintf
(
debugBuf
,
"[GSSLibStub_getContextName] %ld, isSrc=%d"
,
sprintf
(
debugBuf
,
"[GSSLibStub_getContextName] %ld, isSrc=%d"
,
(
long
)
contextHdl
,
isSrc
);
(
long
)
contextHdl
,
isSrc
);
...
@@ -1129,13 +1130,13 @@ Java_sun_security_jgss_wrapper_GSSLibStub_getContextName(JNIEnv *env,
...
@@ -1129,13 +1130,13 @@ Java_sun_security_jgss_wrapper_GSSLibStub_getContextName(JNIEnv *env,
checkStatus
(
env
,
jobj
,
major
,
minor
,
"[GSSLibStub_inquireContextAll]"
);
checkStatus
(
env
,
jobj
,
major
,
minor
,
"[GSSLibStub_inquireContextAll]"
);
/* return immediately if an exception has occurred */
/* return immediately if an exception has occurred */
if
((
*
env
)
->
ExceptionCheck
(
env
))
{
if
((
*
env
)
->
ExceptionCheck
(
env
))
{
return
(
long
)
NULL
;
return
ptr_to_jlong
(
NULL
)
;
}
}
sprintf
(
debugBuf
,
"[GSSLibStub_getContextName] pName=%ld"
,
(
long
)
nameHdl
);
sprintf
(
debugBuf
,
"[GSSLibStub_getContextName] pName=%ld"
,
(
long
)
nameHdl
);
debug
(
env
,
debugBuf
);
debug
(
env
,
debugBuf
);
return
(
jlong
)
nameHdl
;
return
ptr_to_jlong
(
nameHdl
)
;
}
}
/*
/*
...
@@ -1151,7 +1152,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_getContextTime(JNIEnv *env,
...
@@ -1151,7 +1152,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_getContextTime(JNIEnv *env,
gss_ctx_id_t
contextHdl
;
gss_ctx_id_t
contextHdl
;
OM_uint32
time
;
OM_uint32
time
;
contextHdl
=
(
gss_ctx_id_t
)
pContext
;
contextHdl
=
(
gss_ctx_id_t
)
jlong_to_ptr
(
pContext
)
;
sprintf
(
debugBuf
,
"[GSSLibStub_getContextTime] %ld"
,
(
long
)
contextHdl
);
sprintf
(
debugBuf
,
"[GSSLibStub_getContextTime] %ld"
,
(
long
)
contextHdl
);
debug
(
env
,
debugBuf
);
debug
(
env
,
debugBuf
);
...
@@ -1180,17 +1181,17 @@ Java_sun_security_jgss_wrapper_GSSLibStub_deleteContext(JNIEnv *env,
...
@@ -1180,17 +1181,17 @@ Java_sun_security_jgss_wrapper_GSSLibStub_deleteContext(JNIEnv *env,
OM_uint32
minor
,
major
;
OM_uint32
minor
,
major
;
gss_ctx_id_t
contextHdl
;
gss_ctx_id_t
contextHdl
;
contextHdl
=
(
gss_ctx_id_t
)
pContext
;
contextHdl
=
(
gss_ctx_id_t
)
jlong_to_ptr
(
pContext
)
;
sprintf
(
debugBuf
,
"[GSSLibStub_deleteContext] %ld"
,
(
long
)
contextHdl
);
sprintf
(
debugBuf
,
"[GSSLibStub_deleteContext] %ld"
,
(
long
)
contextHdl
);
debug
(
env
,
debugBuf
);
debug
(
env
,
debugBuf
);
if
(
contextHdl
==
GSS_C_NO_CONTEXT
)
return
GSS_C_NO_CONTEXT
;
if
(
contextHdl
==
GSS_C_NO_CONTEXT
)
return
ptr_to_jlong
(
GSS_C_NO_CONTEXT
)
;
/* gss_delete_sec_context(...) => GSS_S_NO_CONTEXT(!) */
/* gss_delete_sec_context(...) => GSS_S_NO_CONTEXT(!) */
major
=
(
*
ftab
->
deleteSecContext
)(
&
minor
,
&
contextHdl
,
GSS_C_NO_BUFFER
);
major
=
(
*
ftab
->
deleteSecContext
)(
&
minor
,
&
contextHdl
,
GSS_C_NO_BUFFER
);
checkStatus
(
env
,
jobj
,
major
,
minor
,
"[GSSLibStub_deleteContext]"
);
checkStatus
(
env
,
jobj
,
major
,
minor
,
"[GSSLibStub_deleteContext]"
);
return
(
jlong
)
contextHdl
;
return
(
jlong
)
ptr_to_jlong
(
contextHdl
)
;
}
}
/*
/*
...
@@ -1211,7 +1212,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_wrapSizeLimit(JNIEnv *env,
...
@@ -1211,7 +1212,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_wrapSizeLimit(JNIEnv *env,
OM_uint32
outSize
,
maxInSize
;
OM_uint32
outSize
,
maxInSize
;
gss_qop_t
qop
;
gss_qop_t
qop
;
contextHdl
=
(
gss_ctx_id_t
)
pContext
;
contextHdl
=
(
gss_ctx_id_t
)
jlong_to_ptr
(
pContext
)
;
sprintf
(
debugBuf
,
"[GSSLibStub_wrapSizeLimit] %ld"
,
(
long
)
contextHdl
);
sprintf
(
debugBuf
,
"[GSSLibStub_wrapSizeLimit] %ld"
,
(
long
)
contextHdl
);
debug
(
env
,
debugBuf
);
debug
(
env
,
debugBuf
);
...
@@ -1244,7 +1245,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_exportContext(JNIEnv *env,
...
@@ -1244,7 +1245,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_exportContext(JNIEnv *env,
gss_buffer_desc
interProcToken
;
gss_buffer_desc
interProcToken
;
jbyteArray
jresult
;
jbyteArray
jresult
;
contextHdl
=
(
gss_ctx_id_t
)
pContext
;
contextHdl
=
(
gss_ctx_id_t
)
jlong_to_ptr
(
pContext
)
;
sprintf
(
debugBuf
,
"[GSSLibStub_exportContext] %ld"
,
(
long
)
contextHdl
);
sprintf
(
debugBuf
,
"[GSSLibStub_exportContext] %ld"
,
(
long
)
contextHdl
);
debug
(
env
,
debugBuf
);
debug
(
env
,
debugBuf
);
...
@@ -1281,7 +1282,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_getMic(JNIEnv *env, jobject jobj,
...
@@ -1281,7 +1282,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_getMic(JNIEnv *env, jobject jobj,
gss_buffer_desc
msgToken
;
gss_buffer_desc
msgToken
;
jbyteArray
jresult
;
jbyteArray
jresult
;
contextHdl
=
(
gss_ctx_id_t
)
pContext
;
contextHdl
=
(
gss_ctx_id_t
)
jlong_to_ptr
(
pContext
)
;
sprintf
(
debugBuf
,
"[GSSLibStub_getMic] %ld"
,
(
long
)
contextHdl
);
sprintf
(
debugBuf
,
"[GSSLibStub_getMic] %ld"
,
(
long
)
contextHdl
);
debug
(
env
,
debugBuf
);
debug
(
env
,
debugBuf
);
...
@@ -1290,7 +1291,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_getMic(JNIEnv *env, jobject jobj,
...
@@ -1290,7 +1291,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_getMic(JNIEnv *env, jobject jobj,
checkStatus
(
env
,
jobj
,
GSS_S_CONTEXT_EXPIRED
,
0
,
"[GSSLibStub_getMic]"
);
checkStatus
(
env
,
jobj
,
GSS_S_CONTEXT_EXPIRED
,
0
,
"[GSSLibStub_getMic]"
);
return
NULL
;
return
NULL
;
}
}
contextHdl
=
(
gss_ctx_id_t
)
pContext
;
contextHdl
=
(
gss_ctx_id_t
)
jlong_to_ptr
(
pContext
)
;
qop
=
(
gss_qop_t
)
jqop
;
qop
=
(
gss_qop_t
)
jqop
;
initGSSBuffer
(
env
,
jmsg
,
&
msg
);
initGSSBuffer
(
env
,
jmsg
,
&
msg
);
...
@@ -1326,7 +1327,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_verifyMic(JNIEnv *env,
...
@@ -1326,7 +1327,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_verifyMic(JNIEnv *env,
gss_buffer_desc
msgToken
;
gss_buffer_desc
msgToken
;
gss_qop_t
qop
;
gss_qop_t
qop
;
contextHdl
=
(
gss_ctx_id_t
)
pContext
;
contextHdl
=
(
gss_ctx_id_t
)
jlong_to_ptr
(
pContext
)
;
sprintf
(
debugBuf
,
"[GSSLibStub_verifyMic] %ld"
,
(
long
)
contextHdl
);
sprintf
(
debugBuf
,
"[GSSLibStub_verifyMic] %ld"
,
(
long
)
contextHdl
);
debug
(
env
,
debugBuf
);
debug
(
env
,
debugBuf
);
...
@@ -1376,7 +1377,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_wrap(JNIEnv *env,
...
@@ -1376,7 +1377,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_wrap(JNIEnv *env,
gss_ctx_id_t
contextHdl
;
gss_ctx_id_t
contextHdl
;
jbyteArray
jresult
;
jbyteArray
jresult
;
contextHdl
=
(
gss_ctx_id_t
)
pContext
;
contextHdl
=
(
gss_ctx_id_t
)
jlong_to_ptr
(
pContext
)
;
sprintf
(
debugBuf
,
"[GSSLibStub_wrap] %ld"
,
(
long
)
contextHdl
);
sprintf
(
debugBuf
,
"[GSSLibStub_wrap] %ld"
,
(
long
)
contextHdl
);
debug
(
env
,
debugBuf
);
debug
(
env
,
debugBuf
);
...
@@ -1427,7 +1428,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_unwrap(JNIEnv *env,
...
@@ -1427,7 +1428,7 @@ Java_sun_security_jgss_wrapper_GSSLibStub_unwrap(JNIEnv *env,
gss_qop_t
qop
;
gss_qop_t
qop
;
jbyteArray
jresult
;
jbyteArray
jresult
;
contextHdl
=
(
gss_ctx_id_t
)
pContext
;
contextHdl
=
(
gss_ctx_id_t
)
jlong_to_ptr
(
pContext
)
;
sprintf
(
debugBuf
,
"[GSSLibStub_unwrap] %ld"
,
(
long
)
contextHdl
);
sprintf
(
debugBuf
,
"[GSSLibStub_unwrap] %ld"
,
(
long
)
contextHdl
);
debug
(
env
,
debugBuf
);
debug
(
env
,
debugBuf
);
...
...
src/share/native/sun/security/jgss/wrapper/NativeUtil.c
浏览文件 @
776ce47e
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#include "NativeUtil.h"
#include "NativeUtil.h"
#include "NativeFunc.h"
#include "NativeFunc.h"
#include "jlong.h"
const
int
JAVA_DUPLICATE_TOKEN_CODE
=
19
;
/* DUPLICATE_TOKEN */
const
int
JAVA_DUPLICATE_TOKEN_CODE
=
19
;
/* DUPLICATE_TOKEN */
const
int
JAVA_OLD_TOKEN_CODE
=
20
;
/* OLD_TOKEN */
const
int
JAVA_OLD_TOKEN_CODE
=
20
;
/* OLD_TOKEN */
...
@@ -412,7 +413,7 @@ OM_uint32 getGSSTime(jint jtime) {
...
@@ -412,7 +413,7 @@ OM_uint32 getGSSTime(jint jtime) {
OM_uint32
result
;
OM_uint32
result
;
/* special handle values equal to JAVA_MAX */
/* special handle values equal to JAVA_MAX */
if
(
jtime
==
JAVA_MAX
)
{
if
(
jtime
==
(
jint
)
JAVA_MAX
)
{
result
=
GSS_C_INDEFINITE
;
result
=
GSS_C_INDEFINITE
;
}
else
{
}
else
{
result
=
jtime
;
result
=
jtime
;
...
@@ -482,7 +483,7 @@ jstring getMinorMessage(JNIEnv *env, jobject jstub, OM_uint32 statusValue) {
...
@@ -482,7 +483,7 @@ jstring getMinorMessage(JNIEnv *env, jobject jstub, OM_uint32 statusValue) {
messageContext
=
0
;
messageContext
=
0
;
if
(
jstub
!=
NULL
)
{
if
(
jstub
!=
NULL
)
{
mech
=
(
gss_OID
)
(
*
env
)
->
GetLongField
(
env
,
jstub
,
FID_GSSLibStub_pMech
);
mech
=
(
gss_OID
)
jlong_to_ptr
((
*
env
)
->
GetLongField
(
env
,
jstub
,
FID_GSSLibStub_pMech
)
);
}
else
{
}
else
{
mech
=
GSS_C_NO_OID
;
mech
=
GSS_C_NO_OID
;
}
}
...
...
src/share/native/sun/security/pkcs11/wrapper/p11_convert.c
浏览文件 @
776ce47e
...
@@ -422,6 +422,7 @@ CK_ATTRIBUTE jAttributeToCKAttribute(JNIEnv *env, jobject jAttribute)
...
@@ -422,6 +422,7 @@ CK_ATTRIBUTE jAttributeToCKAttribute(JNIEnv *env, jobject jAttribute)
jfieldID
jFieldID
;
jfieldID
jFieldID
;
jlong
jType
;
jlong
jType
;
jobject
jPValue
;
jobject
jPValue
;
memset
(
&
ckAttribute
,
0
,
sizeof
(
CK_ATTRIBUTE
));
// TBD: what if jAttribute == NULL?!
// TBD: what if jAttribute == NULL?!
...
@@ -1577,6 +1578,7 @@ CK_RSA_PKCS_PSS_PARAMS jRsaPkcsPssParamToCKRsaPkcsPssParam(JNIEnv *env, jobject
...
@@ -1577,6 +1578,7 @@ CK_RSA_PKCS_PSS_PARAMS jRsaPkcsPssParamToCKRsaPkcsPssParam(JNIEnv *env, jobject
CK_RSA_PKCS_PSS_PARAMS
ckParam
;
CK_RSA_PKCS_PSS_PARAMS
ckParam
;
jfieldID
fieldID
;
jfieldID
fieldID
;
jlong
jHashAlg
,
jMgf
,
jSLen
;
jlong
jHashAlg
,
jMgf
,
jSLen
;
memset
(
&
ckParam
,
0
,
sizeof
(
CK_RSA_PKCS_PSS_PARAMS
));
/* get hashAlg */
/* get hashAlg */
jRsaPkcsPssParamsClass
=
(
*
env
)
->
FindClass
(
env
,
CLASS_RSA_PKCS_PSS_PARAMS
);
jRsaPkcsPssParamsClass
=
(
*
env
)
->
FindClass
(
env
,
CLASS_RSA_PKCS_PSS_PARAMS
);
...
@@ -1617,6 +1619,7 @@ CK_ECDH1_DERIVE_PARAMS jEcdh1DeriveParamToCKEcdh1DeriveParam(JNIEnv *env, jobjec
...
@@ -1617,6 +1619,7 @@ CK_ECDH1_DERIVE_PARAMS jEcdh1DeriveParamToCKEcdh1DeriveParam(JNIEnv *env, jobjec
jfieldID
fieldID
;
jfieldID
fieldID
;
jlong
jLong
;
jlong
jLong
;
jobject
jSharedData
,
jPublicData
;
jobject
jSharedData
,
jPublicData
;
memset
(
&
ckParam
,
0
,
sizeof
(
CK_ECDH1_DERIVE_PARAMS
));
/* get kdf */
/* get kdf */
jEcdh1DeriveParamsClass
=
(
*
env
)
->
FindClass
(
env
,
CLASS_ECDH1_DERIVE_PARAMS
);
jEcdh1DeriveParamsClass
=
(
*
env
)
->
FindClass
(
env
,
CLASS_ECDH1_DERIVE_PARAMS
);
...
@@ -1663,6 +1666,7 @@ CK_ECDH2_DERIVE_PARAMS jEcdh2DeriveParamToCKEcdh2DeriveParam(JNIEnv *env, jobjec
...
@@ -1663,6 +1666,7 @@ CK_ECDH2_DERIVE_PARAMS jEcdh2DeriveParamToCKEcdh2DeriveParam(JNIEnv *env, jobjec
jfieldID
fieldID
;
jfieldID
fieldID
;
jlong
jKdf
,
jPrivateDataLen
,
jPrivateData
;
jlong
jKdf
,
jPrivateDataLen
,
jPrivateData
;
jobject
jSharedData
,
jPublicData
,
jPublicData2
;
jobject
jSharedData
,
jPublicData
,
jPublicData2
;
memset
(
&
ckParam
,
0
,
sizeof
(
CK_ECDH2_DERIVE_PARAMS
));
/* get kdf */
/* get kdf */
jEcdh2DeriveParamsClass
=
(
*
env
)
->
FindClass
(
env
,
CLASS_ECDH2_DERIVE_PARAMS
);
jEcdh2DeriveParamsClass
=
(
*
env
)
->
FindClass
(
env
,
CLASS_ECDH2_DERIVE_PARAMS
);
...
...
src/share/native/sun/security/pkcs11/wrapper/p11_crypt.c
浏览文件 @
776ce47e
...
@@ -180,14 +180,14 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1EncryptUpdate
...
@@ -180,14 +180,14 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1EncryptUpdate
ckSessionHandle
=
jLongToCKULong
(
jSessionHandle
);
ckSessionHandle
=
jLongToCKULong
(
jSessionHandle
);
if
(
directIn
!=
0
)
{
if
(
directIn
!=
0
)
{
inBufP
=
(
CK_BYTE_PTR
)
directIn
;
inBufP
=
(
CK_BYTE_PTR
)
jlong_to_ptr
(
directIn
)
;
}
else
{
}
else
{
inBufP
=
(
*
env
)
->
GetPrimitiveArrayCritical
(
env
,
jIn
,
NULL
);
inBufP
=
(
*
env
)
->
GetPrimitiveArrayCritical
(
env
,
jIn
,
NULL
);
if
(
inBufP
==
NULL
)
{
return
0
;
}
if
(
inBufP
==
NULL
)
{
return
0
;
}
}
}
if
(
directOut
!=
0
)
{
if
(
directOut
!=
0
)
{
outBufP
=
(
CK_BYTE_PTR
)
directOut
;
outBufP
=
(
CK_BYTE_PTR
)
jlong_to_ptr
(
directOut
)
;
}
else
{
}
else
{
outBufP
=
(
*
env
)
->
GetPrimitiveArrayCritical
(
env
,
jOut
,
NULL
);
outBufP
=
(
*
env
)
->
GetPrimitiveArrayCritical
(
env
,
jOut
,
NULL
);
if
(
outBufP
==
NULL
)
{
if
(
outBufP
==
NULL
)
{
...
@@ -249,7 +249,7 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1EncryptFinal
...
@@ -249,7 +249,7 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1EncryptFinal
ckSessionHandle
=
jLongToCKULong
(
jSessionHandle
);
ckSessionHandle
=
jLongToCKULong
(
jSessionHandle
);
if
(
directOut
!=
0
)
{
if
(
directOut
!=
0
)
{
outBufP
=
(
CK_BYTE_PTR
)
directOut
;
outBufP
=
(
CK_BYTE_PTR
)
jlong_to_ptr
(
directOut
)
;
}
else
{
}
else
{
outBufP
=
(
*
env
)
->
GetPrimitiveArrayCritical
(
env
,
jOut
,
NULL
);
outBufP
=
(
*
env
)
->
GetPrimitiveArrayCritical
(
env
,
jOut
,
NULL
);
if
(
outBufP
==
NULL
)
{
return
0
;
}
if
(
outBufP
==
NULL
)
{
return
0
;
}
...
@@ -401,14 +401,14 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1DecryptUpdate
...
@@ -401,14 +401,14 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1DecryptUpdate
ckSessionHandle
=
jLongToCKULong
(
jSessionHandle
);
ckSessionHandle
=
jLongToCKULong
(
jSessionHandle
);
if
(
directIn
!=
0
)
{
if
(
directIn
!=
0
)
{
inBufP
=
(
CK_BYTE_PTR
)
directIn
;
inBufP
=
(
CK_BYTE_PTR
)
jlong_to_ptr
(
directIn
)
;
}
else
{
}
else
{
inBufP
=
(
*
env
)
->
GetPrimitiveArrayCritical
(
env
,
jIn
,
NULL
);
inBufP
=
(
*
env
)
->
GetPrimitiveArrayCritical
(
env
,
jIn
,
NULL
);
if
(
inBufP
==
NULL
)
{
return
0
;
}
if
(
inBufP
==
NULL
)
{
return
0
;
}
}
}
if
(
directOut
!=
0
)
{
if
(
directOut
!=
0
)
{
outBufP
=
(
CK_BYTE_PTR
)
directOut
;
outBufP
=
(
CK_BYTE_PTR
)
jlong_to_ptr
(
directOut
)
;
}
else
{
}
else
{
outBufP
=
(
*
env
)
->
GetPrimitiveArrayCritical
(
env
,
jOut
,
NULL
);
outBufP
=
(
*
env
)
->
GetPrimitiveArrayCritical
(
env
,
jOut
,
NULL
);
if
(
outBufP
==
NULL
)
{
if
(
outBufP
==
NULL
)
{
...
@@ -465,7 +465,7 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1DecryptFinal
...
@@ -465,7 +465,7 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1DecryptFinal
ckSessionHandle
=
jLongToCKULong
(
jSessionHandle
);
ckSessionHandle
=
jLongToCKULong
(
jSessionHandle
);
if
(
directOut
!=
0
)
{
if
(
directOut
!=
0
)
{
outBufP
=
(
CK_BYTE_PTR
)
directOut
;
outBufP
=
(
CK_BYTE_PTR
)
jlong_to_ptr
(
directOut
)
;
}
else
{
}
else
{
outBufP
=
(
*
env
)
->
GetPrimitiveArrayCritical
(
env
,
jOut
,
NULL
);
outBufP
=
(
*
env
)
->
GetPrimitiveArrayCritical
(
env
,
jOut
,
NULL
);
if
(
outBufP
==
NULL
)
{
return
0
;
}
if
(
outBufP
==
NULL
)
{
return
0
;
}
...
...
src/share/native/sun/security/pkcs11/wrapper/p11_digest.c
浏览文件 @
776ce47e
...
@@ -51,6 +51,7 @@
...
@@ -51,6 +51,7 @@
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include <assert.h>
#include <assert.h>
#include "jlong.h"
#include "sun_security_pkcs11_wrapper_PKCS11.h"
#include "sun_security_pkcs11_wrapper_PKCS11.h"
...
@@ -178,7 +179,7 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1DigestUpdate
...
@@ -178,7 +179,7 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1DigestUpdate
ckSessionHandle
=
jLongToCKULong
(
jSessionHandle
);
ckSessionHandle
=
jLongToCKULong
(
jSessionHandle
);
if
(
directIn
!=
0
)
{
if
(
directIn
!=
0
)
{
rv
=
(
*
ckpFunctions
->
C_DigestUpdate
)(
ckSessionHandle
,
(
CK_BYTE_PTR
)
directIn
,
jInLen
);
rv
=
(
*
ckpFunctions
->
C_DigestUpdate
)(
ckSessionHandle
,
(
CK_BYTE_PTR
)
jlong_to_ptr
(
directIn
)
,
jInLen
);
ckAssertReturnValueOK
(
env
,
rv
);
ckAssertReturnValueOK
(
env
,
rv
);
return
;
return
;
}
}
...
...
src/share/native/sun/security/pkcs11/wrapper/p11_general.c
浏览文件 @
776ce47e
...
@@ -253,10 +253,12 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1GetInfo
...
@@ -253,10 +253,12 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1GetInfo
(
JNIEnv
*
env
,
jobject
obj
)
(
JNIEnv
*
env
,
jobject
obj
)
{
{
CK_INFO
ckLibInfo
;
CK_INFO
ckLibInfo
;
jobject
jInfoObject
;
jobject
jInfoObject
=
NULL
;
CK_RV
rv
;
CK_RV
rv
;
CK_FUNCTION_LIST_PTR
ckpFunctions
;
memset
(
&
ckLibInfo
,
0
,
sizeof
(
CK_INFO
));
CK_FUNCTION_LIST_PTR
ckpFunctions
=
getFunctionList
(
env
,
obj
);
ckpFunctions
=
getFunctionList
(
env
,
obj
);
if
(
ckpFunctions
==
NULL
)
{
return
NULL
;
}
if
(
ckpFunctions
==
NULL
)
{
return
NULL
;
}
rv
=
(
*
ckpFunctions
->
C_GetInfo
)(
&
ckLibInfo
);
rv
=
(
*
ckpFunctions
->
C_GetInfo
)(
&
ckLibInfo
);
...
@@ -384,7 +386,7 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1GetSlotInfo
...
@@ -384,7 +386,7 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1GetSlotInfo
{
{
CK_SLOT_ID
ckSlotID
;
CK_SLOT_ID
ckSlotID
;
CK_SLOT_INFO
ckSlotInfo
;
CK_SLOT_INFO
ckSlotInfo
;
jobject
jSlotInfoObject
;
jobject
jSlotInfoObject
=
NULL
;
CK_RV
rv
;
CK_RV
rv
;
CK_FUNCTION_LIST_PTR
ckpFunctions
=
getFunctionList
(
env
,
obj
);
CK_FUNCTION_LIST_PTR
ckpFunctions
=
getFunctionList
(
env
,
obj
);
...
@@ -396,7 +398,7 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1GetSlotInfo
...
@@ -396,7 +398,7 @@ Java_sun_security_pkcs11_wrapper_PKCS11_C_1GetSlotInfo
if
(
ckAssertReturnValueOK
(
env
,
rv
)
==
CK_ASSERT_OK
)
{
if
(
ckAssertReturnValueOK
(
env
,
rv
)
==
CK_ASSERT_OK
)
{
jSlotInfoObject
=
ckSlotInfoPtrToJSlotInfo
(
env
,
&
ckSlotInfo
);
jSlotInfoObject
=
ckSlotInfoPtrToJSlotInfo
(
env
,
&
ckSlotInfo
);
}
}
return
jSlotInfoObject
;
return
jSlotInfoObject
;
}
}
/*
/*
...
...
src/share/native/sun/security/pkcs11/wrapper/p11_sessmgmt.c
浏览文件 @
776ce47e
...
@@ -256,7 +256,7 @@ JNIEXPORT jobject JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1GetSessionI
...
@@ -256,7 +256,7 @@ JNIEXPORT jobject JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1GetSessionI
{
{
CK_SESSION_HANDLE
ckSessionHandle
;
CK_SESSION_HANDLE
ckSessionHandle
;
CK_SESSION_INFO
ckSessionInfo
;
CK_SESSION_INFO
ckSessionInfo
;
jobject
jSessionInfo
;
jobject
jSessionInfo
=
NULL
;
CK_RV
rv
;
CK_RV
rv
;
CK_FUNCTION_LIST_PTR
ckpFunctions
=
getFunctionList
(
env
,
obj
);
CK_FUNCTION_LIST_PTR
ckpFunctions
=
getFunctionList
(
env
,
obj
);
...
...
src/share/native/sun/security/pkcs11/wrapper/p11_sign.c
浏览文件 @
776ce47e
...
@@ -51,6 +51,7 @@
...
@@ -51,6 +51,7 @@
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include <assert.h>
#include <assert.h>
#include "jlong.h"
#include "sun_security_pkcs11_wrapper_PKCS11.h"
#include "sun_security_pkcs11_wrapper_PKCS11.h"
...
@@ -198,7 +199,7 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1SignUpdate
...
@@ -198,7 +199,7 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1SignUpdate
ckSessionHandle
=
jLongToCKULong
(
jSessionHandle
);
ckSessionHandle
=
jLongToCKULong
(
jSessionHandle
);
if
(
directIn
!=
0
)
{
if
(
directIn
!=
0
)
{
rv
=
(
*
ckpFunctions
->
C_SignUpdate
)(
ckSessionHandle
,
(
CK_BYTE_PTR
)
directIn
,
jInLen
);
rv
=
(
*
ckpFunctions
->
C_SignUpdate
)(
ckSessionHandle
,
(
CK_BYTE_PTR
)
jlong_to_ptr
(
directIn
)
,
jInLen
);
ckAssertReturnValueOK
(
env
,
rv
);
ckAssertReturnValueOK
(
env
,
rv
);
return
;
return
;
}
}
...
@@ -262,7 +263,7 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1SignFina
...
@@ -262,7 +263,7 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1SignFina
ckSessionHandle
=
jLongToCKULong
(
jSessionHandle
);
ckSessionHandle
=
jLongToCKULong
(
jSessionHandle
);
if
((
jExpectedLength
>
0
)
&&
(
jExpectedLength
<
ckSignatureLength
))
{
if
((
jExpectedLength
>
0
)
&&
(
(
CK_ULONG
)
jExpectedLength
<
ckSignatureLength
))
{
ckSignatureLength
=
jExpectedLength
;
ckSignatureLength
=
jExpectedLength
;
}
}
...
@@ -496,7 +497,7 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1VerifyUpdate
...
@@ -496,7 +497,7 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_C_1VerifyUpdate
ckSessionHandle
=
jLongToCKULong
(
jSessionHandle
);
ckSessionHandle
=
jLongToCKULong
(
jSessionHandle
);
if
(
directIn
!=
0
)
{
if
(
directIn
!=
0
)
{
rv
=
(
*
ckpFunctions
->
C_VerifyUpdate
)(
ckSessionHandle
,
(
CK_BYTE_PTR
)
directIn
,
jInLen
);
rv
=
(
*
ckpFunctions
->
C_VerifyUpdate
)(
ckSessionHandle
,
(
CK_BYTE_PTR
)
jlong_to_ptr
(
directIn
)
,
jInLen
);
ckAssertReturnValueOK
(
env
,
rv
);
ckAssertReturnValueOK
(
env
,
rv
);
return
;
return
;
}
}
...
...
src/share/native/sun/security/pkcs11/wrapper/p11_util.c
浏览文件 @
776ce47e
...
@@ -106,7 +106,7 @@ void putModuleEntry(JNIEnv *env, jobject pkcs11Implementation, ModuleData *modul
...
@@ -106,7 +106,7 @@ void putModuleEntry(JNIEnv *env, jobject pkcs11Implementation, ModuleData *modul
if
(
moduleData
==
NULL
)
{
if
(
moduleData
==
NULL
)
{
return
;
return
;
}
}
(
*
env
)
->
SetLongField
(
env
,
pkcs11Implementation
,
pNativeDataID
,
(
jlong
)
moduleData
);
(
*
env
)
->
SetLongField
(
env
,
pkcs11Implementation
,
pNativeDataID
,
ptr_to_jlong
(
moduleData
)
);
}
}
...
@@ -120,7 +120,7 @@ ModuleData * getModuleEntry(JNIEnv *env, jobject pkcs11Implementation) {
...
@@ -120,7 +120,7 @@ ModuleData * getModuleEntry(JNIEnv *env, jobject pkcs11Implementation) {
return
NULL
;
return
NULL
;
}
}
jData
=
(
*
env
)
->
GetLongField
(
env
,
pkcs11Implementation
,
pNativeDataID
);
jData
=
(
*
env
)
->
GetLongField
(
env
,
pkcs11Implementation
,
pNativeDataID
);
return
(
ModuleData
*
)
j
Data
;
return
(
ModuleData
*
)
j
long_to_ptr
(
jData
)
;
}
}
CK_FUNCTION_LIST_PTR
getFunctionList
(
JNIEnv
*
env
,
jobject
pkcs11Implementation
)
{
CK_FUNCTION_LIST_PTR
getFunctionList
(
JNIEnv
*
env
,
jobject
pkcs11Implementation
)
{
...
...
src/solaris/native/sun/security/pkcs11/j2secmod_md.c
浏览文件 @
776ce47e
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
#include "j2secmod.h"
#include "j2secmod.h"
void
*
findFunction
(
JNIEnv
*
env
,
jlong
jHandle
,
const
char
*
functionName
)
{
void
*
findFunction
(
JNIEnv
*
env
,
jlong
jHandle
,
const
char
*
functionName
)
{
void
*
hModule
=
(
void
*
)
j
Handle
;
void
*
hModule
=
(
void
*
)
j
long_to_ptr
(
jHandle
)
;
void
*
fAddress
=
dlsym
(
hModule
,
functionName
);
void
*
fAddress
=
dlsym
(
hModule
,
functionName
);
if
(
fAddress
==
NULL
)
{
if
(
fAddress
==
NULL
)
{
char
errorMessage
[
256
];
char
errorMessage
[
256
];
...
@@ -53,7 +53,7 @@ JNIEXPORT jlong JNICALL Java_sun_security_pkcs11_Secmod_nssGetLibraryHandle
...
@@ -53,7 +53,7 @@ JNIEXPORT jlong JNICALL Java_sun_security_pkcs11_Secmod_nssGetLibraryHandle
void
*
hModule
=
dlopen
(
libName
,
RTLD_NOLOAD
);
void
*
hModule
=
dlopen
(
libName
,
RTLD_NOLOAD
);
dprintf2
(
"-handle for %s: %u
\n
"
,
libName
,
hModule
);
dprintf2
(
"-handle for %s: %u
\n
"
,
libName
,
hModule
);
(
*
env
)
->
ReleaseStringUTFChars
(
env
,
jLibName
,
libName
);
(
*
env
)
->
ReleaseStringUTFChars
(
env
,
jLibName
,
libName
);
return
(
jlong
)
hModule
;
return
ptr_to_jlong
(
hModule
)
;
}
}
JNIEXPORT
jlong
JNICALL
Java_sun_security_pkcs11_Secmod_nssLoadLibrary
JNIEXPORT
jlong
JNICALL
Java_sun_security_pkcs11_Secmod_nssLoadLibrary
...
@@ -72,5 +72,5 @@ JNIEXPORT jlong JNICALL Java_sun_security_pkcs11_Secmod_nssLoadLibrary
...
@@ -72,5 +72,5 @@ JNIEXPORT jlong JNICALL Java_sun_security_pkcs11_Secmod_nssLoadLibrary
return
0
;
return
0
;
}
}
return
(
jlong
)
hModule
;
return
ptr_to_jlong
(
hModule
)
;
}
}
src/solaris/native/sun/security/pkcs11/wrapper/p11_md.c
浏览文件 @
776ce47e
...
@@ -79,7 +79,7 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_connect
...
@@ -79,7 +79,7 @@ JNIEXPORT void JNICALL Java_sun_security_pkcs11_wrapper_PKCS11_connect
{
{
void
*
hModule
;
void
*
hModule
;
char
*
error
;
char
*
error
;
CK_C_GetFunctionList
C_GetFunctionList
;
CK_C_GetFunctionList
C_GetFunctionList
=
NULL
;
CK_RV
rv
;
CK_RV
rv
;
ModuleData
*
moduleData
;
ModuleData
*
moduleData
;
jobject
globalPKCS11ImplementationReference
;
jobject
globalPKCS11ImplementationReference
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录