diff --git a/src/share/native/sun/security/ec/ECC_JNI.cpp b/src/share/native/sun/security/ec/ECC_JNI.cpp index 457fb05808265319a6aa8719bbe232a8de1f51b6..249d2e74ed18f5aaa3da2270007ffb7f59d38ae5 100644 --- a/src/share/native/sun/security/ec/ECC_JNI.cpp +++ b/src/share/native/sun/security/ec/ECC_JNI.cpp @@ -38,7 +38,7 @@ extern "C" { /* * Throws an arbitrary Java exception. */ -void ThrowException(JNIEnv *env, char *exceptionName) +void ThrowException(JNIEnv *env, const char *exceptionName) { jclass exceptionClazz = env->FindClass(exceptionName); env->ThrowNew(exceptionClazz, NULL); @@ -89,7 +89,7 @@ JNICALL Java_sun_security_ec_ECKeyPairGenerator_generateECKeyPair // Fill a new ECParams using the supplied OID if (EC_DecodeParams(¶ms_item, &ecparams, 0) != SECSuccess) { /* bad curve OID */ - ThrowException(env, (char *) INVALID_ALGORITHM_PARAMETER_EXCEPTION); + ThrowException(env, INVALID_ALGORITHM_PARAMETER_EXCEPTION); goto cleanup; } @@ -101,7 +101,7 @@ JNICALL Java_sun_security_ec_ECKeyPairGenerator_generateECKeyPair // Generate the new keypair (using the supplied seed) if (EC_NewKey(ecparams, &privKey, (unsigned char *) pSeedBuffer, jSeedLength, 0) != SECSuccess) { - ThrowException(env, (char *) KEY_EXCEPTION); + ThrowException(env, KEY_EXCEPTION); goto cleanup; } diff --git a/src/share/native/sun/security/ec/impl/ec.c b/src/share/native/sun/security/ec/impl/ec.c index 65a9b388e144d52575cc0dd84a7f263ff03482cd..11777de8746fcf0267b3e8fa59a698f9a546e06c 100644 --- a/src/share/native/sun/security/ec/impl/ec.c +++ b/src/share/native/sun/security/ec/impl/ec.c @@ -51,12 +51,10 @@ * *********************************************************************** */ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "mplogic.h" #include "ec.h" #include "ecl.h" @@ -67,6 +65,7 @@ #include #ifndef _WIN32 +#include #include #endif /* _WIN32 */ @@ -116,7 +115,7 @@ ec_points_mul(const ECParams *params, const mp_int *k1, const mp_int *k2, ECGroup *group = NULL; SECStatus rv = SECFailure; mp_err err = MP_OKAY; - int len; + unsigned int len; #if EC_DEBUG int i; @@ -278,10 +277,6 @@ ec_NewKey(ECParams *ecParams, ECPrivateKey **privKey, printf("ec_NewKey called\n"); #endif -#ifndef _WIN32 -int printf(); -#endif /* _WIN32 */ - if (!ecParams || !privKey || !privKeyBytes || (privKeyLen < 0)) { PORT_SetError(SEC_ERROR_INVALID_ARGS); return SECFailure; @@ -361,8 +356,9 @@ int printf(); cleanup: mp_clear(&k); - if (rv) + if (rv) { PORT_FreeArena(arena, PR_TRUE); + } #if EC_DEBUG printf("ec_NewKey returning %s\n", @@ -504,7 +500,7 @@ EC_ValidatePublicKey(ECParams *ecParams, SECItem *publicValue, int kmflag) ECGroup *group = NULL; SECStatus rv = SECFailure; mp_err err = MP_OKAY; - int len; + unsigned int len; if (!ecParams || !publicValue) { PORT_SetError(SEC_ERROR_INVALID_ARGS); @@ -778,7 +774,7 @@ ECDSA_SignDigestWithSeed(ECPrivateKey *key, SECItem *signature, /* In the definition of EC signing, digests are truncated * to the length of n in bits. * (see SEC 1 "Elliptic Curve Digit Signature Algorithm" section 4.1.*/ - if (digest->len*8 > ecParams->fieldID.size) { + if (digest->len*8 > (unsigned int)ecParams->fieldID.size) { mpl_rsh(&s,&s,digest->len*8 - ecParams->fieldID.size); } @@ -993,7 +989,8 @@ ECDSA_VerifyDigest(ECPublicKey *key, const SECItem *signature, /* In the definition of EC signing, digests are truncated * to the length of n in bits. * (see SEC 1 "Elliptic Curve Digit Signature Algorithm" section 4.1.*/ - if (digest->len*8 > ecParams->fieldID.size) { /* u1 = HASH(M') */ + /* u1 = HASH(M') */ + if (digest->len*8 > (unsigned int)ecParams->fieldID.size) { mpl_rsh(&u1,&u1,digest->len*8- ecParams->fieldID.size); } diff --git a/src/share/native/sun/security/ec/impl/ec.h b/src/share/native/sun/security/ec/impl/ec.h index e8d034ca4935dcf8bd6e96231a8f6fe3eb31a5fd..f5f3d356e26ddd393aef4ca9dfa218278bd4f29f 100644 --- a/src/share/native/sun/security/ec/impl/ec.h +++ b/src/share/native/sun/security/ec/impl/ec.h @@ -57,8 +57,6 @@ #ifndef __ec_h_ #define __ec_h_ -#pragma ident "%Z%%M% %I% %E% SMI" - #define EC_DEBUG 0 #define EC_POINT_FORM_COMPRESSED_Y0 0x02 #define EC_POINT_FORM_COMPRESSED_Y1 0x03 diff --git a/src/share/native/sun/security/ec/impl/ec2.h b/src/share/native/sun/security/ec/impl/ec2.h index 6541f039d4c51810b30a0af092f9869f424c08e8..e297a309218de2df3808d071c2062b367cc6798d 100644 --- a/src/share/native/sun/security/ec/impl/ec2.h +++ b/src/share/native/sun/security/ec/impl/ec2.h @@ -57,8 +57,6 @@ #ifndef _EC2_H #define _EC2_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecl-priv.h" /* Checks if point P(px, py) is at infinity. Uses affine coordinates. */ diff --git a/src/share/native/sun/security/ec/impl/ec2_163.c b/src/share/native/sun/security/ec/impl/ec2_163.c index 4aadc4e8d3767719a3acffc7aabc9578696bb6fc..c1dc55dea35d6fb8981b39986b12ead2eddbb4aa 100644 --- a/src/share/native/sun/security/ec/impl/ec2_163.c +++ b/src/share/native/sun/security/ec/impl/ec2_163.c @@ -56,8 +56,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ec2.h" #include "mp_gf2m.h" #include "mp_gf2m-priv.h" diff --git a/src/share/native/sun/security/ec/impl/ec2_193.c b/src/share/native/sun/security/ec/impl/ec2_193.c index ddaf97323f042fbafa7c6efbd747b94ad20f0776..aa7f29f0823ac50315c02f0ad30748fc574b2fab 100644 --- a/src/share/native/sun/security/ec/impl/ec2_193.c +++ b/src/share/native/sun/security/ec/impl/ec2_193.c @@ -56,8 +56,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ec2.h" #include "mp_gf2m.h" #include "mp_gf2m-priv.h" diff --git a/src/share/native/sun/security/ec/impl/ec2_233.c b/src/share/native/sun/security/ec/impl/ec2_233.c index 8e81c81ebb59b028f78841a5d6ce194510e06869..485b104ce2a94cfcfa1f9d634d9d04ad47b9937f 100644 --- a/src/share/native/sun/security/ec/impl/ec2_233.c +++ b/src/share/native/sun/security/ec/impl/ec2_233.c @@ -56,8 +56,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ec2.h" #include "mp_gf2m.h" #include "mp_gf2m-priv.h" diff --git a/src/share/native/sun/security/ec/impl/ec2_aff.c b/src/share/native/sun/security/ec/impl/ec2_aff.c index 2865b2826d3d6440aa12450c8062fc25f977c970..f77eba3f4992c310cb60a1df6976ce3451987975 100644 --- a/src/share/native/sun/security/ec/impl/ec2_aff.c +++ b/src/share/native/sun/security/ec/impl/ec2_aff.c @@ -54,8 +54,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ec2.h" #include "mplogic.h" #include "mp_gf2m.h" diff --git a/src/share/native/sun/security/ec/impl/ec2_mont.c b/src/share/native/sun/security/ec/impl/ec2_mont.c index 3f5faec42b420619877615980ebe50fabcad8553..eda921f3ff6e0cd41202cdd3a89e5d879875b1b6 100644 --- a/src/share/native/sun/security/ec/impl/ec2_mont.c +++ b/src/share/native/sun/security/ec/impl/ec2_mont.c @@ -56,8 +56,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ec2.h" #include "mplogic.h" #include "mp_gf2m.h" diff --git a/src/share/native/sun/security/ec/impl/ec_naf.c b/src/share/native/sun/security/ec/impl/ec_naf.c index 2827d459b1aa6468ff5d13cf51fc515c2ba20fea..e6307f0d1089d344f3a0835946c53eef1eefd887 100644 --- a/src/share/native/sun/security/ec/impl/ec_naf.c +++ b/src/share/native/sun/security/ec/impl/ec_naf.c @@ -54,8 +54,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecl-priv.h" /* Returns 2^e as an integer. This is meant to be used for small powers of diff --git a/src/share/native/sun/security/ec/impl/ecc_impl.h b/src/share/native/sun/security/ec/impl/ecc_impl.h index 7d50aa199bb805dd19431430cd432919f62c70eb..23357ae8c42cace2726f77c046564bb5d0d8986f 100644 --- a/src/share/native/sun/security/ec/impl/ecc_impl.h +++ b/src/share/native/sun/security/ec/impl/ecc_impl.h @@ -51,15 +51,13 @@ * *********************************************************************** */ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. */ #ifndef _ECC_IMPL_H #define _ECC_IMPL_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif @@ -82,6 +80,7 @@ typedef enum { B_FALSE, B_TRUE } boolean_t; typedef unsigned char uint8_t; typedef unsigned long ulong_t; typedef enum boolean { B_FALSE, B_TRUE } boolean_t; +#define strdup _strdup /* Replace POSIX name with ISO C++ name */ #endif /* _WIN32 */ #ifndef _KERNEL diff --git a/src/share/native/sun/security/ec/impl/ecdecode.c b/src/share/native/sun/security/ec/impl/ecdecode.c index 19c62403c6467d29047ad40c40d85ba678da89d3..826192161ee1dc3caa030b021c7208d40dc01139 100644 --- a/src/share/native/sun/security/ec/impl/ecdecode.c +++ b/src/share/native/sun/security/ec/impl/ecdecode.c @@ -55,8 +55,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #ifndef _WIN32 @@ -90,7 +88,7 @@ hexString2SECItem(PRArenaPool *arena, SECItem *item, const char *str, { int i = 0; int byteval = 0; - int tmp = strlen(str); + int tmp = (int)strlen(str); if ((tmp % 2) != 0) return NULL; @@ -134,7 +132,8 @@ gf_populate_params(ECCurveName name, ECFieldType field_type, ECParams *params, /* 2 ['0'+'4'] + MAX_ECKEY_LEN * 2 [x,y] * 2 [hex string] + 1 ['\0'] */ char genenc[3 + 2 * 2 * MAX_ECKEY_LEN]; - if ((name < ECCurve_noName) || (name > ECCurve_pastLastCurve)) goto cleanup; + if (((int)name < ECCurve_noName) || (name > ECCurve_pastLastCurve)) + goto cleanup; params->name = name; curveParams = ecCurve_map[params->name]; CHECK_OK(curveParams); diff --git a/src/share/native/sun/security/ec/impl/ecl-curve.h b/src/share/native/sun/security/ec/impl/ecl-curve.h index c7683031c4a038410c25cde7d492fce840c76739..865c3d49feb4d84b5c67dc54db4b6dae776e3046 100644 --- a/src/share/native/sun/security/ec/impl/ecl-curve.h +++ b/src/share/native/sun/security/ec/impl/ecl-curve.h @@ -57,8 +57,6 @@ #ifndef _ECL_CURVE_H #define _ECL_CURVE_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecl-exp.h" #ifndef _KERNEL #include diff --git a/src/share/native/sun/security/ec/impl/ecl-exp.h b/src/share/native/sun/security/ec/impl/ecl-exp.h index 4c7698d7b0c81beb6fd92b688af90598c32f6a03..51ed43fdbc24e019de757a8fcb4a98e581093fd7 100644 --- a/src/share/native/sun/security/ec/impl/ecl-exp.h +++ b/src/share/native/sun/security/ec/impl/ecl-exp.h @@ -57,8 +57,6 @@ #ifndef _ECL_EXP_H #define _ECL_EXP_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* Curve field type */ typedef enum { ECField_GFp, diff --git a/src/share/native/sun/security/ec/impl/ecl-priv.h b/src/share/native/sun/security/ec/impl/ecl-priv.h index 5b744c0917c6f5ab28ff89c0daf14f121be7cb77..6b032eabecca42f3d2a81182069f3411be510ee6 100644 --- a/src/share/native/sun/security/ec/impl/ecl-priv.h +++ b/src/share/native/sun/security/ec/impl/ecl-priv.h @@ -58,8 +58,6 @@ #ifndef _ECL_PRIV_H #define _ECL_PRIV_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecl.h" #include "mpi.h" #include "mplogic.h" @@ -90,6 +88,10 @@ s = ACCUM(w); \ cout = CARRYOUT(w); } +/* Handle case when carry-in value is zero */ +#define MP_ADD_CARRY_ZERO(a1, a2, s, cout) \ + MP_ADD_CARRY(a1, a2, s, 0, cout); + #define MP_SUB_BORROW(a1, a2, s, bin, bout) \ { mp_word w; \ w = ((mp_word)(a1)) - (a2) - (bin); \ @@ -111,6 +113,15 @@ s = sum += (cin); \ cout = tmp + (sum < (cin)); } +/* Handle case when carry-in value is zero */ +#define MP_ADD_CARRY_ZERO(a1, a2, s, cout) \ + { mp_digit tmp,sum; \ + tmp = (a1); \ + sum = tmp + (a2); \ + tmp = (sum < tmp); /* detect overflow */ \ + s = sum; \ + cout = tmp; } + #define MP_SUB_BORROW(a1, a2, s, bin, bout) \ { mp_digit tmp; \ tmp = (a1); \ diff --git a/src/share/native/sun/security/ec/impl/ecl.c b/src/share/native/sun/security/ec/impl/ecl.c index 3c609ead78312e441a15b1b6fdef7e4d717d9dc3..79c5467cf079469056a57c7011d5e9c5de36030c 100644 --- a/src/share/native/sun/security/ec/impl/ecl.c +++ b/src/share/native/sun/security/ec/impl/ecl.c @@ -54,8 +54,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "mpi.h" #include "mplogic.h" #include "ecl.h" diff --git a/src/share/native/sun/security/ec/impl/ecl.h b/src/share/native/sun/security/ec/impl/ecl.h index d5143ad66733ef668140bbf31c49c8cf1e3fbed6..ab956d89fbc721a286aafe80ba84a3ed8b05e1f1 100644 --- a/src/share/native/sun/security/ec/impl/ecl.h +++ b/src/share/native/sun/security/ec/impl/ecl.h @@ -57,8 +57,6 @@ #ifndef _ECL_H #define _ECL_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* Although this is not an exported header file, code which uses elliptic * curve point operations will need to include it. */ diff --git a/src/share/native/sun/security/ec/impl/ecl_curve.c b/src/share/native/sun/security/ec/impl/ecl_curve.c index f25732a9c46b68f1c2c0383a4e455e9b5d345181..a253a363f6a74334cbf372b566b13a94db63cc04 100644 --- a/src/share/native/sun/security/ec/impl/ecl_curve.c +++ b/src/share/native/sun/security/ec/impl/ecl_curve.c @@ -54,8 +54,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecl.h" #include "ecl-curve.h" #include "ecl-priv.h" diff --git a/src/share/native/sun/security/ec/impl/ecl_gf.c b/src/share/native/sun/security/ec/impl/ecl_gf.c index a478b58236fcc6673dad80b8764a5bb6d1cb6fbf..46b8dff029581a384fdbf9f8a2971e761c1ced8c 100644 --- a/src/share/native/sun/security/ec/impl/ecl_gf.c +++ b/src/share/native/sun/security/ec/impl/ecl_gf.c @@ -55,8 +55,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "mpi.h" #include "mp_gf2m.h" #include "ecl-priv.h" @@ -307,7 +305,7 @@ ec_GFp_add_3(const mp_int *a, const mp_int *b, mp_int *r, } #ifndef MPI_AMD64_ADD - MP_ADD_CARRY(a0, r0, r0, 0, carry); + MP_ADD_CARRY_ZERO(a0, r0, r0, carry); MP_ADD_CARRY(a1, r1, r1, carry, carry); MP_ADD_CARRY(a2, r2, r2, carry, carry); #else @@ -394,7 +392,7 @@ ec_GFp_add_4(const mp_int *a, const mp_int *b, mp_int *r, } #ifndef MPI_AMD64_ADD - MP_ADD_CARRY(a0, r0, r0, 0, carry); + MP_ADD_CARRY_ZERO(a0, r0, r0, carry); MP_ADD_CARRY(a1, r1, r1, carry, carry); MP_ADD_CARRY(a2, r2, r2, carry, carry); MP_ADD_CARRY(a3, r3, r3, carry, carry); @@ -491,7 +489,7 @@ ec_GFp_add_5(const mp_int *a, const mp_int *b, mp_int *r, r0 = MP_DIGIT(b,0); } - MP_ADD_CARRY(a0, r0, r0, 0, carry); + MP_ADD_CARRY_ZERO(a0, r0, r0, carry); MP_ADD_CARRY(a1, r1, r1, carry, carry); MP_ADD_CARRY(a2, r2, r2, carry, carry); MP_ADD_CARRY(a3, r3, r3, carry, carry); @@ -572,7 +570,7 @@ ec_GFp_add_6(const mp_int *a, const mp_int *b, mp_int *r, r0 = MP_DIGIT(b,0); } - MP_ADD_CARRY(a0, r0, r0, 0, carry); + MP_ADD_CARRY_ZERO(a0, r0, r0, carry); MP_ADD_CARRY(a1, r1, r1, carry, carry); MP_ADD_CARRY(a2, r2, r2, carry, carry); MP_ADD_CARRY(a3, r3, r3, carry, carry); @@ -675,7 +673,7 @@ ec_GFp_sub_3(const mp_int *a, const mp_int *b, mp_int *r, b1 = MP_DIGIT(&meth->irr,1); b0 = MP_DIGIT(&meth->irr,0); #ifndef MPI_AMD64_ADD - MP_ADD_CARRY(b0, r0, r0, 0, borrow); + MP_ADD_CARRY_ZERO(b0, r0, r0, borrow); MP_ADD_CARRY(b1, r1, r1, borrow, borrow); MP_ADD_CARRY(b2, r2, r2, borrow, borrow); #else @@ -766,7 +764,7 @@ ec_GFp_sub_4(const mp_int *a, const mp_int *b, mp_int *r, b1 = MP_DIGIT(&meth->irr,1); b0 = MP_DIGIT(&meth->irr,0); #ifndef MPI_AMD64_ADD - MP_ADD_CARRY(b0, r0, r0, 0, borrow); + MP_ADD_CARRY_ZERO(b0, r0, r0, borrow); MP_ADD_CARRY(b1, r1, r1, borrow, borrow); MP_ADD_CARRY(b2, r2, r2, borrow, borrow); MP_ADD_CARRY(b3, r3, r3, borrow, borrow); @@ -850,7 +848,7 @@ ec_GFp_sub_5(const mp_int *a, const mp_int *b, mp_int *r, b2 = MP_DIGIT(&meth->irr,2); b1 = MP_DIGIT(&meth->irr,1); b0 = MP_DIGIT(&meth->irr,0); - MP_ADD_CARRY(b0, r0, r0, 0, borrow); + MP_ADD_CARRY_ZERO(b0, r0, r0, borrow); MP_ADD_CARRY(b1, r1, r1, borrow, borrow); MP_ADD_CARRY(b2, r2, r2, borrow, borrow); MP_ADD_CARRY(b3, r3, r3, borrow, borrow); @@ -924,7 +922,7 @@ ec_GFp_sub_6(const mp_int *a, const mp_int *b, mp_int *r, b2 = MP_DIGIT(&meth->irr,2); b1 = MP_DIGIT(&meth->irr,1); b0 = MP_DIGIT(&meth->irr,0); - MP_ADD_CARRY(b0, r0, r0, 0, borrow); + MP_ADD_CARRY_ZERO(b0, r0, r0, borrow); MP_ADD_CARRY(b1, r1, r1, borrow, borrow); MP_ADD_CARRY(b2, r2, r2, borrow, borrow); MP_ADD_CARRY(b3, r3, r3, borrow, borrow); diff --git a/src/share/native/sun/security/ec/impl/ecl_mult.c b/src/share/native/sun/security/ec/impl/ecl_mult.c index 4393c82fcf3ef13d4bd8d14d4ed985d611638eb7..5c43ae8cf0e868a80bed8d46ccf0a83e0e8302e3 100644 --- a/src/share/native/sun/security/ec/impl/ecl_mult.c +++ b/src/share/native/sun/security/ec/impl/ecl_mult.c @@ -54,8 +54,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "mpi.h" #include "mplogic.h" #include "ecl.h" diff --git a/src/share/native/sun/security/ec/impl/ecp.h b/src/share/native/sun/security/ec/impl/ecp.h index f9d8b01241a767b9bf408c3a10b36d737caaa3a0..97220f3d39f8c5b35c3f5e6f99c65229dfe11469 100644 --- a/src/share/native/sun/security/ec/impl/ecp.h +++ b/src/share/native/sun/security/ec/impl/ecp.h @@ -57,8 +57,6 @@ #ifndef _ECP_H #define _ECP_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecl-priv.h" /* Checks if point P(px, py) is at infinity. Uses affine coordinates. */ diff --git a/src/share/native/sun/security/ec/impl/ecp_192.c b/src/share/native/sun/security/ec/impl/ecp_192.c index 23f49eadaf93072d8ca834a93f1a7e29fc2b7ba9..dcdd9dbe618b3d9ee8fb494baf4d4f1adb3a7b28 100644 --- a/src/share/native/sun/security/ec/impl/ecp_192.c +++ b/src/share/native/sun/security/ec/impl/ecp_192.c @@ -54,8 +54,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecp.h" #include "mpi.h" #include "mplogic.h" @@ -210,15 +208,15 @@ ec_GFp_nistp192_mod(const mp_int *a, mp_int *r, const GFMethod *meth) /* implement r = (a2,a1,a0)+(a5,a5,a5)+(a4,a4,0)+(0,a3,a3) */ #ifndef MPI_AMD64_ADD - MP_ADD_CARRY(r0, a3, r0, 0, carry); + MP_ADD_CARRY_ZERO(r0, a3, r0, carry); MP_ADD_CARRY(r1, a3, r1, carry, carry); MP_ADD_CARRY(r2, a4, r2, carry, carry); r3 = carry; - MP_ADD_CARRY(r0, a5, r0, 0, carry); + MP_ADD_CARRY_ZERO(r0, a5, r0, carry); MP_ADD_CARRY(r1, a5, r1, carry, carry); MP_ADD_CARRY(r2, a5, r2, carry, carry); r3 += carry; - MP_ADD_CARRY(r1, a4, r1, 0, carry); + MP_ADD_CARRY_ZERO(r1, a4, r1, carry); MP_ADD_CARRY(r2, 0, r2, carry, carry); r3 += carry; @@ -251,7 +249,7 @@ ec_GFp_nistp192_mod(const mp_int *a, mp_int *r, const GFMethod *meth) /* reduce out the carry */ while (r3) { #ifndef MPI_AMD64_ADD - MP_ADD_CARRY(r0, r3, r0, 0, carry); + MP_ADD_CARRY_ZERO(r0, r3, r0, carry); MP_ADD_CARRY(r1, r3, r1, carry, carry); MP_ADD_CARRY(r2, 0, r2, carry, carry); r3 = carry; @@ -335,7 +333,7 @@ ec_GFp_nistp192_add(const mp_int *a, const mp_int *b, mp_int *r, } #ifndef MPI_AMD64_ADD - MP_ADD_CARRY(a0, r0, r0, 0, carry); + MP_ADD_CARRY_ZERO(a0, r0, r0, carry); MP_ADD_CARRY(a1, r1, r1, carry, carry); MP_ADD_CARRY(a2, r2, r2, carry, carry); #else @@ -357,7 +355,7 @@ ec_GFp_nistp192_add(const mp_int *a, const mp_int *b, mp_int *r, ((r1 == MP_DIGIT_MAX) || ((r1 == (MP_DIGIT_MAX-1)) && (r0 == MP_DIGIT_MAX))))) { #ifndef MPI_AMD64_ADD - MP_ADD_CARRY(r0, 1, r0, 0, carry); + MP_ADD_CARRY_ZERO(r0, 1, r0, carry); MP_ADD_CARRY(r1, 1, r1, carry, carry); MP_ADD_CARRY(r2, 0, r2, carry, carry); #else diff --git a/src/share/native/sun/security/ec/impl/ecp_224.c b/src/share/native/sun/security/ec/impl/ecp_224.c index 7d8023835538592914d85a7e95cea7401f77cafa..96d775f9e870a1905dd835ce035cd494758075a2 100644 --- a/src/share/native/sun/security/ec/impl/ecp_224.c +++ b/src/share/native/sun/security/ec/impl/ecp_224.c @@ -54,8 +54,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecp.h" #include "mpi.h" #include "mplogic.h" @@ -251,10 +249,10 @@ ec_GFp_nistp224_mod(const mp_int *a, mp_int *r, const GFMethod *meth) +( 0, a6,a5b, 0) -( 0 0, 0|a6b, a6a|a5b ) -( a6b, a6a|a5b, a5a|a4b, a4a|a3b ) */ - MP_ADD_CARRY (r1, a3b, r1, 0, carry); + MP_ADD_CARRY_ZERO (r1, a3b, r1, carry); MP_ADD_CARRY (r2, a4 , r2, carry, carry); MP_ADD_CARRY (r3, a5a, r3, carry, carry); - MP_ADD_CARRY (r1, a5b, r1, 0, carry); + MP_ADD_CARRY_ZERO (r1, a5b, r1, carry); MP_ADD_CARRY (r2, a6 , r2, carry, carry); MP_ADD_CARRY (r3, 0, r3, carry, carry); @@ -275,7 +273,7 @@ ec_GFp_nistp224_mod(const mp_int *a, mp_int *r, const GFMethod *meth) r3b = (int)(r3 >>32); while (r3b > 0) { r3 &= 0xffffffff; - MP_ADD_CARRY(r1,((mp_digit)r3b) << 32, r1, 0, carry); + MP_ADD_CARRY_ZERO(r1,((mp_digit)r3b) << 32, r1, carry); if (carry) { MP_ADD_CARRY(r2, 0, r2, carry, carry); MP_ADD_CARRY(r3, 0, r3, carry, carry); @@ -290,7 +288,7 @@ ec_GFp_nistp224_mod(const mp_int *a, mp_int *r, const GFMethod *meth) } while (r3b < 0) { - MP_ADD_CARRY (r0, 1, r0, 0, carry); + MP_ADD_CARRY_ZERO (r0, 1, r0, carry); MP_ADD_CARRY (r1, MP_DIGIT_MAX <<32, r1, carry, carry); MP_ADD_CARRY (r2, MP_DIGIT_MAX, r2, carry, carry); MP_ADD_CARRY (r3, MP_DIGIT_MAX >> 32, r3, carry, carry); diff --git a/src/share/native/sun/security/ec/impl/ecp_256.c b/src/share/native/sun/security/ec/impl/ecp_256.c index f8c5720ac85f7a1de347108c2121f959024b663f..ef8290856632f533f8911726ae18bfa1202377b6 100644 --- a/src/share/native/sun/security/ec/impl/ecp_256.c +++ b/src/share/native/sun/security/ec/impl/ecp_256.c @@ -54,8 +54,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecp.h" #include "mpi.h" #include "mplogic.h" @@ -303,32 +301,32 @@ ec_GFp_nistp256_mod(const mp_int *a, mp_int *r, const GFMethod *meth) r0 = MP_DIGIT(a,0); /* sum 1 */ - MP_ADD_CARRY(r1, a5h << 32, r1, 0, carry); + MP_ADD_CARRY_ZERO(r1, a5h << 32, r1, carry); MP_ADD_CARRY(r2, a6, r2, carry, carry); MP_ADD_CARRY(r3, a7, r3, carry, carry); r4 = carry; - MP_ADD_CARRY(r1, a5h << 32, r1, 0, carry); + MP_ADD_CARRY_ZERO(r1, a5h << 32, r1, carry); MP_ADD_CARRY(r2, a6, r2, carry, carry); MP_ADD_CARRY(r3, a7, r3, carry, carry); r4 += carry; /* sum 2 */ - MP_ADD_CARRY(r1, a6l, r1, 0, carry); + MP_ADD_CARRY_ZERO(r1, a6l, r1, carry); MP_ADD_CARRY(r2, a6h | a7l, r2, carry, carry); MP_ADD_CARRY(r3, a7h, r3, carry, carry); r4 += carry; - MP_ADD_CARRY(r1, a6l, r1, 0, carry); + MP_ADD_CARRY_ZERO(r1, a6l, r1, carry); MP_ADD_CARRY(r2, a6h | a7l, r2, carry, carry); MP_ADD_CARRY(r3, a7h, r3, carry, carry); r4 += carry; /* sum 3 */ - MP_ADD_CARRY(r0, a4, r0, 0, carry); + MP_ADD_CARRY_ZERO(r0, a4, r0, carry); MP_ADD_CARRY(r1, a5l >> 32, r1, carry, carry); MP_ADD_CARRY(r2, 0, r2, carry, carry); MP_ADD_CARRY(r3, a7, r3, carry, carry); r4 += carry; /* sum 4 */ - MP_ADD_CARRY(r0, a4h | a5l, r0, 0, carry); + MP_ADD_CARRY_ZERO(r0, a4h | a5l, r0, carry); MP_ADD_CARRY(r1, a5h|(a6h<<32), r1, carry, carry); MP_ADD_CARRY(r2, a7, r2, carry, carry); MP_ADD_CARRY(r3, a6h | a4l, r3, carry, carry); @@ -362,7 +360,7 @@ ec_GFp_nistp256_mod(const mp_int *a, mp_int *r, const GFMethod *meth) while (r4 > 0) { mp_digit r4_long = r4; mp_digit r4l = (r4_long << 32); - MP_ADD_CARRY(r0, r4_long, r0, 0, carry); + MP_ADD_CARRY_ZERO(r0, r4_long, r0, carry); MP_ADD_CARRY(r1, -r4l, r1, carry, carry); MP_ADD_CARRY(r2, MP_DIGIT_MAX, r2, carry, carry); MP_ADD_CARRY(r3, r4l-r4_long-1,r3, carry, carry); diff --git a/src/share/native/sun/security/ec/impl/ecp_384.c b/src/share/native/sun/security/ec/impl/ecp_384.c index c9d9d0f05a298a9b35df5c4c283590ff3457ea9b..263fecb888f2535856e85b71389ced209b388faa 100644 --- a/src/share/native/sun/security/ec/impl/ecp_384.c +++ b/src/share/native/sun/security/ec/impl/ecp_384.c @@ -54,8 +54,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecp.h" #include "mpi.h" #include "mplogic.h" diff --git a/src/share/native/sun/security/ec/impl/ecp_521.c b/src/share/native/sun/security/ec/impl/ecp_521.c index b76436a43edcc8600dce95bb0deec1fe9e946e76..239b1289372bbcc4a0787288adaf3a79eabeddf4 100644 --- a/src/share/native/sun/security/ec/impl/ecp_521.c +++ b/src/share/native/sun/security/ec/impl/ecp_521.c @@ -50,12 +50,10 @@ * *********************************************************************** */ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecp.h" #include "mpi.h" #include "mplogic.h" @@ -74,7 +72,7 @@ ec_GFp_nistp521_mod(const mp_int *a, mp_int *r, const GFMethod *meth) { mp_err res = MP_OKAY; int a_bits = mpl_significant_bits(a); - int i; + unsigned int i; /* m1, m2 are statically-allocated mp_int of exactly the size we need */ mp_int m1; diff --git a/src/share/native/sun/security/ec/impl/ecp_aff.c b/src/share/native/sun/security/ec/impl/ecp_aff.c index c987a8887d20a4bfaa9b820ec25a868c16c8e157..a3a97f62570417341999abf1be047b882059cf15 100644 --- a/src/share/native/sun/security/ec/impl/ecp_aff.c +++ b/src/share/native/sun/security/ec/impl/ecp_aff.c @@ -59,8 +59,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecp.h" #include "mplogic.h" #ifndef _KERNEL diff --git a/src/share/native/sun/security/ec/impl/ecp_jac.c b/src/share/native/sun/security/ec/impl/ecp_jac.c index 2ff3e4d57c871a90c93359d73a3d7f958e759b4a..8b35dae8e995ca6118065ea25990e511ee3695bb 100644 --- a/src/share/native/sun/security/ec/impl/ecp_jac.c +++ b/src/share/native/sun/security/ec/impl/ecp_jac.c @@ -59,8 +59,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecp.h" #include "mplogic.h" #ifndef _KERNEL diff --git a/src/share/native/sun/security/ec/impl/ecp_jm.c b/src/share/native/sun/security/ec/impl/ecp_jm.c index 572ed0628002d21baccb81dead9e8bcf6727470e..b85615be7add52c1b2aa65a32f2eb7ce435420a2 100644 --- a/src/share/native/sun/security/ec/impl/ecp_jm.c +++ b/src/share/native/sun/security/ec/impl/ecp_jm.c @@ -54,8 +54,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecp.h" #include "ecl-priv.h" #include "mplogic.h" diff --git a/src/share/native/sun/security/ec/impl/ecp_mont.c b/src/share/native/sun/security/ec/impl/ecp_mont.c index ff51d90bb8895df58a83e9d551102943b6c67040..6519eda7bc08c359455e2bad6e70f849a872d70e 100644 --- a/src/share/native/sun/security/ec/impl/ecp_mont.c +++ b/src/share/native/sun/security/ec/impl/ecp_mont.c @@ -54,8 +54,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* Uses Montgomery reduction for field arithmetic. See mpi/mpmontg.c for * code implementation. */ diff --git a/src/share/native/sun/security/ec/impl/logtab.h b/src/share/native/sun/security/ec/impl/logtab.h index bcc13ebb10723e3e6c23c3c7d74e755e0303b2e3..f4b40008b4a56090d704e7d4621f0bc4d425e3e5 100644 --- a/src/share/native/sun/security/ec/impl/logtab.h +++ b/src/share/native/sun/security/ec/impl/logtab.h @@ -57,8 +57,6 @@ #ifndef _LOGTAB_H #define _LOGTAB_H -#pragma ident "%Z%%M% %I% %E% SMI" - const float s_logv_2[] = { 0.000000000f, 0.000000000f, 1.000000000f, 0.630929754f, /* 0 1 2 3 */ 0.500000000f, 0.430676558f, 0.386852807f, 0.356207187f, /* 4 5 6 7 */ diff --git a/src/share/native/sun/security/ec/impl/mp_gf2m-priv.h b/src/share/native/sun/security/ec/impl/mp_gf2m-priv.h index 7cdacc7751b6695197608f59b0e339b2fd11bfa4..889bfd1bed0b4e45f877207f51cb6ec6b72428a0 100644 --- a/src/share/native/sun/security/ec/impl/mp_gf2m-priv.h +++ b/src/share/native/sun/security/ec/impl/mp_gf2m-priv.h @@ -58,8 +58,6 @@ #ifndef _MP_GF2M_PRIV_H_ #define _MP_GF2M_PRIV_H_ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "mpi-priv.h" extern const mp_digit mp_gf2m_sqr_tb[16]; diff --git a/src/share/native/sun/security/ec/impl/mp_gf2m.c b/src/share/native/sun/security/ec/impl/mp_gf2m.c index beb798c10b2dba77660bf638baf78d77cc9654a7..2c021c88a24b616b2704888b4fd27074c37d7517 100644 --- a/src/share/native/sun/security/ec/impl/mp_gf2m.c +++ b/src/share/native/sun/security/ec/impl/mp_gf2m.c @@ -55,8 +55,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "mp_gf2m.h" #include "mp_gf2m-priv.h" #include "mplogic.h" diff --git a/src/share/native/sun/security/ec/impl/mp_gf2m.h b/src/share/native/sun/security/ec/impl/mp_gf2m.h index dff8094f507ddc6266a46d9b0e7f5d65ee20548e..f689ba35358cdbc1d71d7967d5d775b242ab17cf 100644 --- a/src/share/native/sun/security/ec/impl/mp_gf2m.h +++ b/src/share/native/sun/security/ec/impl/mp_gf2m.h @@ -58,8 +58,6 @@ #ifndef _MP_GF2M_H_ #define _MP_GF2M_H_ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "mpi.h" mp_err mp_badd(const mp_int *a, const mp_int *b, mp_int *c); diff --git a/src/share/native/sun/security/ec/impl/mpi-config.h b/src/share/native/sun/security/ec/impl/mpi-config.h index c892fbecf3c1da2df13d7517f92dcae42a3ed059..4c2b22b9f12065ffe074b0a87c2bf965135f7272 100644 --- a/src/share/native/sun/security/ec/impl/mpi-config.h +++ b/src/share/native/sun/security/ec/impl/mpi-config.h @@ -57,8 +57,6 @@ #ifndef _MPI_CONFIG_H #define _MPI_CONFIG_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* $Id: mpi-config.h,v 1.5 2004/04/25 15:03:10 gerv%gerv.net Exp $ */ /* diff --git a/src/share/native/sun/security/ec/impl/mpi-priv.h b/src/share/native/sun/security/ec/impl/mpi-priv.h index a5fccf153cc55c5aadb70bb62ad9a61bd68dab6a..9a80f23d02f975b9eeec51ea01efce4ce166d45b 100644 --- a/src/share/native/sun/security/ec/impl/mpi-priv.h +++ b/src/share/native/sun/security/ec/impl/mpi-priv.h @@ -63,8 +63,6 @@ #ifndef _MPI_PRIV_H #define _MPI_PRIV_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* $Id: mpi-priv.h,v 1.20 2005/11/22 07:16:43 relyea%netscape.com Exp $ */ #include "mpi.h" diff --git a/src/share/native/sun/security/ec/impl/mpi.c b/src/share/native/sun/security/ec/impl/mpi.c index e3558a26e812cb81385a310498c6b3976d4fd7d3..a495b998598f43651487d9cc494923a3eb73fdc0 100644 --- a/src/share/native/sun/security/ec/impl/mpi.c +++ b/src/share/native/sun/security/ec/impl/mpi.c @@ -54,12 +54,10 @@ * *********************************************************************** */ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* $Id: mpi.c,v 1.45 2006/09/29 20:12:21 alexei.volkov.bugs%sun.com Exp $ */ #include "mpi-priv.h" @@ -1148,7 +1146,7 @@ mp_err mp_expt(mp_int *a, mp_int *b, mp_int *c) mp_int s, x; mp_err res; mp_digit d; - int dig, bit; + unsigned int dig, bit; ARGCHK(a != NULL && b != NULL && c != NULL, MP_BADARG); @@ -1523,7 +1521,7 @@ mp_err s_mp_exptmod(const mp_int *a, const mp_int *b, const mp_int *m, mp_int *c mp_int s, x, mu; mp_err res; mp_digit d; - int dig, bit; + unsigned int dig, bit; ARGCHK(a != NULL && b != NULL && c != NULL, MP_BADARG); @@ -2057,7 +2055,7 @@ mp_size mp_trailing_zeros(const mp_int *mp) { mp_digit d; mp_size n = 0; - int ix; + unsigned int ix; if (!mp || !MP_DIGITS(mp) || !mp_cmp_z(mp)) return n; @@ -2900,9 +2898,9 @@ void s_mp_copy(const mp_digit *sp, mp_digit *dp, mp_size count) /* Allocate ni records of nb bytes each, and return a pointer to that */ void *s_mp_alloc(size_t nb, size_t ni, int kmflag) { - mp_int *mp; ++mp_allocs; #ifdef _KERNEL + mp_int *mp; mp = kmem_zalloc(nb * ni, kmflag); if (mp != NULL) FLAG(mp) = kmflag; @@ -3112,7 +3110,7 @@ void s_mp_div_2(mp_int *mp) mp_err s_mp_mul_2(mp_int *mp) { mp_digit *pd; - int ix, used; + unsigned int ix, used; mp_digit kin = 0; /* Shift digits leftward by 1 bit */ @@ -4663,7 +4661,7 @@ char s_mp_todigit(mp_digit val, int r, int low) { char ch; - if(val >= r) + if(val >= (unsigned int)r) return 0; ch = s_dmap_1[val]; @@ -4778,7 +4776,7 @@ mp_err mp_to_unsigned_octets(const mp_int *mp, unsigned char *str, mp_size maxlen) { int ix, pos = 0; - int bytes; + unsigned int bytes; ARGCHK(mp != NULL && str != NULL && !SIGN(mp), MP_BADARG); @@ -4810,7 +4808,7 @@ mp_err mp_to_signed_octets(const mp_int *mp, unsigned char *str, mp_size maxlen) { int ix, pos = 0; - int bytes; + unsigned int bytes; ARGCHK(mp != NULL && str != NULL && !SIGN(mp), MP_BADARG); @@ -4850,7 +4848,7 @@ mp_err mp_to_fixlen_octets(const mp_int *mp, unsigned char *str, mp_size length) { int ix, pos = 0; - int bytes; + unsigned int bytes; ARGCHK(mp != NULL && str != NULL && !SIGN(mp), MP_BADARG); diff --git a/src/share/native/sun/security/ec/impl/mpi.h b/src/share/native/sun/security/ec/impl/mpi.h index 4933033d57180534c1797d2c0d8b968b1771444c..d80657e5657cde7738d7210f61fa1e2a8ce4d1dd 100644 --- a/src/share/native/sun/security/ec/impl/mpi.h +++ b/src/share/native/sun/security/ec/impl/mpi.h @@ -60,8 +60,6 @@ #ifndef _MPI_H #define _MPI_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* $Id: mpi.h,v 1.22 2004/04/27 23:04:36 gerv%gerv.net Exp $ */ #include "mpi-config.h" diff --git a/src/share/native/sun/security/ec/impl/mplogic.c b/src/share/native/sun/security/ec/impl/mplogic.c index 531a682a8e4d138153b603c179ab0fdbd56e2130..8de8306ea9e6ee1342515bd9f568d63d1140e665 100644 --- a/src/share/native/sun/security/ec/impl/mplogic.c +++ b/src/share/native/sun/security/ec/impl/mplogic.c @@ -56,8 +56,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* $Id: mplogic.c,v 1.15 2004/04/27 23:04:36 gerv%gerv.net Exp $ */ #include "mpi-priv.h" diff --git a/src/share/native/sun/security/ec/impl/mplogic.h b/src/share/native/sun/security/ec/impl/mplogic.h index d384ea7f39581c8f18ba43a4c4addebc83947fcc..a2f7714bffbe66813b745066272d007531665b41 100644 --- a/src/share/native/sun/security/ec/impl/mplogic.h +++ b/src/share/native/sun/security/ec/impl/mplogic.h @@ -59,8 +59,6 @@ #ifndef _MPLOGIC_H #define _MPLOGIC_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* $Id: mplogic.h,v 1.7 2004/04/27 23:04:36 gerv%gerv.net Exp $ */ #include "mpi.h" diff --git a/src/share/native/sun/security/ec/impl/mpmontg.c b/src/share/native/sun/security/ec/impl/mpmontg.c index a6713751a2966af1ab2b4f47a5a88a8761280b49..c1762847a5eb2fb65cc4de4f13ee719c3cca41ce 100644 --- a/src/share/native/sun/security/ec/impl/mpmontg.c +++ b/src/share/native/sun/security/ec/impl/mpmontg.c @@ -56,8 +56,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* $Id: mpmontg.c,v 1.20 2006/08/29 02:41:38 nelson%bolyard.com Exp $ */ /* This file implements moduluar exponentiation using Montgomery's diff --git a/src/share/native/sun/security/ec/impl/mpprime.h b/src/share/native/sun/security/ec/impl/mpprime.h index a648b0bbfefd59a7ce4627d66c6897b956cac518..b9012af4b316c08172a89aff80c126c3cb553fb9 100644 --- a/src/share/native/sun/security/ec/impl/mpprime.h +++ b/src/share/native/sun/security/ec/impl/mpprime.h @@ -60,8 +60,6 @@ #ifndef _MP_PRIME_H #define _MP_PRIME_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include "mpi.h" extern const int prime_tab_size; /* number of primes available */ diff --git a/src/share/native/sun/security/ec/impl/oid.c b/src/share/native/sun/security/ec/impl/oid.c index 9fc2798f418765057a160d72b34b57dbc434a85b..e5a76992bf987e636ce3bf8d8b21684d77b19c05 100644 --- a/src/share/native/sun/security/ec/impl/oid.c +++ b/src/share/native/sun/security/ec/impl/oid.c @@ -50,12 +50,10 @@ * *********************************************************************** */ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #ifndef _WIN32 @@ -433,8 +431,7 @@ SECOidData * SECOID_FindOID(const SECItem *oid) { SECOidData *po; - SECOidData *ret; - int i; + SECOidData *ret = NULL; if (oid->len == 8) { if (oid->data[6] == 0x00) { @@ -454,8 +451,6 @@ SECOID_FindOID(const SECItem *oid) po = &SECG_oids[oid->data[4]]; if (memcmp(oid->data, po->oid.data, 5) == 0) ret = po; - } else { - ret = NULL; } return(ret); } diff --git a/src/share/native/sun/security/ec/impl/secitem.c b/src/share/native/sun/security/ec/impl/secitem.c index 45d255fda74ae72b91f88b0a1c0f6d2470d3fe29..6cfa5dea4b2019d96b94ea222ed262586446d8ea 100644 --- a/src/share/native/sun/security/ec/impl/secitem.c +++ b/src/share/native/sun/security/ec/impl/secitem.c @@ -53,8 +53,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Support routines for SECItem data structure. * diff --git a/src/share/native/sun/security/ec/impl/secoidt.h b/src/share/native/sun/security/ec/impl/secoidt.h index b63df8c4e468ba699a8ac075abd071289661196b..ea5da257ad78a45dd2c4e7c50cd76854c441beca 100644 --- a/src/share/native/sun/security/ec/impl/secoidt.h +++ b/src/share/native/sun/security/ec/impl/secoidt.h @@ -57,8 +57,6 @@ #ifndef _SECOIDT_H_ #define _SECOIDT_H_ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * secoidt.h - public data structures for ASN.1 OID functions *