diff -r 6d7ae91094e7 -r d93ef1df440d javacommons/security/src/midpauthenticationmoduleimpl.cpp --- a/javacommons/security/src/midpauthenticationmoduleimpl.cpp Tue Jun 22 09:54:11 2010 +0100 +++ b/javacommons/security/src/midpauthenticationmoduleimpl.cpp Thu Jul 22 16:31:34 2010 +0100 @@ -22,6 +22,7 @@ #include "midpauthenticationmoduleimpl.h" #include "storagehandler.h" #include "securityutils.h" +#include "telutils.h" #include "javacertstorehandler.h" #include "securitycommsmessagedefs.h" #include "javastorage.h" @@ -38,8 +39,8 @@ #include #include #include -#include #include +#include using namespace java::security; using namespace java::storage; @@ -252,6 +253,13 @@ jar_hash_value = NULL; return hash; } + else + { + if (errno == ENOENT) + { + SecurityUtils::throw_exception(env, "JAR_NOT_FOUND"); + } + } return NULL; } @@ -455,9 +463,7 @@ break; } - struct timeval tv; - int i = gettimeofday(&tv, NULL); - X509_STORE_CTX_set_time(x509_ctx, X509_V_FLAG_USE_CHECK_TIME, tv.tv_sec); + X509_STORE_CTX_set_time(x509_ctx, X509_V_FLAG_USE_CHECK_TIME, TelUtils::getSecureTime()); // set the callback for validation - needed for the critical extension // used by developer certificates X509_STORE_CTX_set_verify_cb(x509_ctx, verify_callback); @@ -475,7 +481,7 @@ { bool extKeyUsageKnown = false; char EXT_KEY_USAGE_OID[80]; - for (i = 0; i < sk_ASN1_OBJECT_num(extKeyUsage); i++) + for (int i = 0; i < sk_ASN1_OBJECT_num(extKeyUsage); i++) { ASN1_OBJECT *usage = sk_ASN1_OBJECT_value(extKeyUsage,i); OBJ_obj2txt(EXT_KEY_USAGE_OID,