idx int64 | func_before string | Vulnerability Classification string | vul int64 | func_after string | patch string | CWE ID string | lines_before string | lines_after string |
|---|---|---|---|---|---|---|---|---|
9,600 | int RAND_DRBG_set(RAND_DRBG *drbg, int type, unsigned int flags)
{
int ret = 1;
if (type == 0 && flags == 0) {
type = rand_drbg_type;
flags = rand_drbg_flags;
}
/* If set is called multiple times - clear the old one */
if (drbg->type != 0 && (type != drbg->type || flags != drbg->fl... | null | 0 | int RAND_DRBG_set(RAND_DRBG *drbg, int type, unsigned int flags)
{
int ret = 1;
if (type == 0 && flags == 0) {
type = rand_drbg_type;
flags = rand_drbg_flags;
}
/* If set is called multiple times - clear the old one */
if (drbg->type != 0 && (type != drbg->type || flags != drbg->fl... | @@ -197,7 +197,7 @@ static RAND_DRBG *rand_drbg_new(int secure,
}
drbg->secure = secure && CRYPTO_secure_allocated(drbg);
- drbg->fork_count = rand_fork_count;
+ drbg->fork_id = openssl_get_fork_id();
drbg->parent = parent;
if (parent == NULL) {
@@ -578,6 +578,7 @@ int RAND_DRBG_generate(R... | CWE-330 | null | null |
9,601 | int RAND_DRBG_set_defaults(int type, unsigned int flags)
{
int ret = 1;
switch (type) {
default:
RANDerr(RAND_F_RAND_DRBG_SET_DEFAULTS, RAND_R_UNSUPPORTED_DRBG_TYPE);
return 0;
case NID_aes_128_ctr:
case NID_aes_192_ctr:
case NID_aes_256_ctr:
break;
}
if ((flags... | null | 0 | int RAND_DRBG_set_defaults(int type, unsigned int flags)
{
int ret = 1;
switch (type) {
default:
RANDerr(RAND_F_RAND_DRBG_SET_DEFAULTS, RAND_R_UNSUPPORTED_DRBG_TYPE);
return 0;
case NID_aes_128_ctr:
case NID_aes_192_ctr:
case NID_aes_256_ctr:
break;
}
if ((flags... | @@ -197,7 +197,7 @@ static RAND_DRBG *rand_drbg_new(int secure,
}
drbg->secure = secure && CRYPTO_secure_allocated(drbg);
- drbg->fork_count = rand_fork_count;
+ drbg->fork_id = openssl_get_fork_id();
drbg->parent = parent;
if (parent == NULL) {
@@ -578,6 +578,7 @@ int RAND_DRBG_generate(R... | CWE-330 | null | null |
9,602 | int RAND_DRBG_uninstantiate(RAND_DRBG *drbg)
{
if (drbg->meth == NULL) {
drbg->state = DRBG_ERROR;
RANDerr(RAND_F_RAND_DRBG_UNINSTANTIATE,
RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED);
return 0;
}
/* Clear the entire drbg->ctr struct, then reset some important
* memb... | null | 0 | int RAND_DRBG_uninstantiate(RAND_DRBG *drbg)
{
if (drbg->meth == NULL) {
drbg->state = DRBG_ERROR;
RANDerr(RAND_F_RAND_DRBG_UNINSTANTIATE,
RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED);
return 0;
}
/* Clear the entire drbg->ctr struct, then reset some important
* memb... | @@ -197,7 +197,7 @@ static RAND_DRBG *rand_drbg_new(int secure,
}
drbg->secure = secure && CRYPTO_secure_allocated(drbg);
- drbg->fork_count = rand_fork_count;
+ drbg->fork_id = openssl_get_fork_id();
drbg->parent = parent;
if (parent == NULL) {
@@ -578,6 +578,7 @@ int RAND_DRBG_generate(R... | CWE-330 | null | null |
9,603 | int rand_drbg_restart(RAND_DRBG *drbg,
const unsigned char *buffer, size_t len, size_t entropy)
{
int reseeded = 0;
const unsigned char *adin = NULL;
size_t adinlen = 0;
if (drbg->seed_pool != NULL) {
RANDerr(RAND_F_RAND_DRBG_RESTART, ERR_R_INTERNAL_ERROR);
drbg->s... | null | 0 | int rand_drbg_restart(RAND_DRBG *drbg,
const unsigned char *buffer, size_t len, size_t entropy)
{
int reseeded = 0;
const unsigned char *adin = NULL;
size_t adinlen = 0;
if (drbg->seed_pool != NULL) {
RANDerr(RAND_F_RAND_DRBG_RESTART, ERR_R_INTERNAL_ERROR);
drbg->s... | @@ -197,7 +197,7 @@ static RAND_DRBG *rand_drbg_new(int secure,
}
drbg->secure = secure && CRYPTO_secure_allocated(drbg);
- drbg->fork_count = rand_fork_count;
+ drbg->fork_id = openssl_get_fork_id();
drbg->parent = parent;
if (parent == NULL) {
@@ -578,6 +578,7 @@ int RAND_DRBG_generate(R... | CWE-330 | null | null |
9,604 | size_t rand_acquire_entropy_from_tsc(RAND_POOL *pool)
{
unsigned char c;
int i;
if ((OPENSSL_ia32cap_P[0] & (1 << 4)) != 0) {
for (i = 0; i < TSC_READ_COUNT; i++) {
c = (unsigned char)(OPENSSL_rdtsc() & 0xFF);
rand_pool_add(pool, &c, 1, 4);
}
}
return rand_po... | null | 0 | size_t rand_acquire_entropy_from_tsc(RAND_POOL *pool)
{
unsigned char c;
int i;
if ((OPENSSL_ia32cap_P[0] & (1 << 4)) != 0) {
for (i = 0; i < TSC_READ_COUNT; i++) {
c = (unsigned char)(OPENSSL_rdtsc() & 0xFF);
rand_pool_add(pool, &c, 1, 4);
}
}
return rand_po... | @@ -26,8 +26,6 @@ static CRYPTO_RWLOCK *rand_meth_lock;
static const RAND_METHOD *default_RAND_meth;
static CRYPTO_ONCE rand_init = CRYPTO_ONCE_STATIC_INIT;
-int rand_fork_count;
-
static CRYPTO_RWLOCK *rand_nonce_lock;
static int rand_nonce_count;
@@ -303,11 +301,6 @@ void rand_drbg_cleanup_additional_data(RAN... | CWE-330 | null | null |
9,605 | void rand_drbg_cleanup_entropy(RAND_DRBG *drbg,
unsigned char *out, size_t outlen)
{
if (drbg->seed_pool == NULL) {
if (drbg->secure)
OPENSSL_secure_clear_free(out, outlen);
else
OPENSSL_clear_free(out, outlen);
}
}
| null | 0 | void rand_drbg_cleanup_entropy(RAND_DRBG *drbg,
unsigned char *out, size_t outlen)
{
if (drbg->seed_pool == NULL) {
if (drbg->secure)
OPENSSL_secure_clear_free(out, outlen);
else
OPENSSL_clear_free(out, outlen);
}
}
| @@ -26,8 +26,6 @@ static CRYPTO_RWLOCK *rand_meth_lock;
static const RAND_METHOD *default_RAND_meth;
static CRYPTO_ONCE rand_init = CRYPTO_ONCE_STATIC_INIT;
-int rand_fork_count;
-
static CRYPTO_RWLOCK *rand_nonce_lock;
static int rand_nonce_count;
@@ -303,11 +301,6 @@ void rand_drbg_cleanup_additional_data(RAN... | CWE-330 | null | null |
9,606 | void rand_drbg_cleanup_nonce(RAND_DRBG *drbg,
unsigned char *out, size_t outlen)
{
OPENSSL_clear_free(out, outlen);
}
| null | 0 | void rand_drbg_cleanup_nonce(RAND_DRBG *drbg,
unsigned char *out, size_t outlen)
{
OPENSSL_clear_free(out, outlen);
}
| @@ -26,8 +26,6 @@ static CRYPTO_RWLOCK *rand_meth_lock;
static const RAND_METHOD *default_RAND_meth;
static CRYPTO_ONCE rand_init = CRYPTO_ONCE_STATIC_INIT;
-int rand_fork_count;
-
static CRYPTO_RWLOCK *rand_nonce_lock;
static int rand_nonce_count;
@@ -303,11 +301,6 @@ void rand_drbg_cleanup_additional_data(RAN... | CWE-330 | null | null |
9,607 | size_t rand_drbg_get_additional_data(RAND_POOL *pool, unsigned char **pout)
{
size_t ret = 0;
if (rand_pool_add_additional_data(pool) == 0)
goto err;
ret = rand_pool_length(pool);
*pout = rand_pool_detach(pool);
err:
return ret;
}
| null | 0 | size_t rand_drbg_get_additional_data(RAND_POOL *pool, unsigned char **pout)
{
size_t ret = 0;
if (rand_pool_add_additional_data(pool) == 0)
goto err;
ret = rand_pool_length(pool);
*pout = rand_pool_detach(pool);
err:
return ret;
}
| @@ -26,8 +26,6 @@ static CRYPTO_RWLOCK *rand_meth_lock;
static const RAND_METHOD *default_RAND_meth;
static CRYPTO_ONCE rand_init = CRYPTO_ONCE_STATIC_INIT;
-int rand_fork_count;
-
static CRYPTO_RWLOCK *rand_nonce_lock;
static int rand_nonce_count;
@@ -303,11 +301,6 @@ void rand_drbg_cleanup_additional_data(RAN... | CWE-330 | null | null |
9,608 | size_t rand_drbg_get_entropy(RAND_DRBG *drbg,
unsigned char **pout,
int entropy, size_t min_len, size_t max_len,
int prediction_resistance)
{
size_t ret = 0;
size_t entropy_available = 0;
RAND_POOL *pool;
if (drbg->p... | null | 0 | size_t rand_drbg_get_entropy(RAND_DRBG *drbg,
unsigned char **pout,
int entropy, size_t min_len, size_t max_len,
int prediction_resistance)
{
size_t ret = 0;
size_t entropy_available = 0;
RAND_POOL *pool;
if (drbg->p... | @@ -26,8 +26,6 @@ static CRYPTO_RWLOCK *rand_meth_lock;
static const RAND_METHOD *default_RAND_meth;
static CRYPTO_ONCE rand_init = CRYPTO_ONCE_STATIC_INIT;
-int rand_fork_count;
-
static CRYPTO_RWLOCK *rand_nonce_lock;
static int rand_nonce_count;
@@ -303,11 +301,6 @@ void rand_drbg_cleanup_additional_data(RAN... | CWE-330 | null | null |
9,609 | size_t rand_drbg_get_nonce(RAND_DRBG *drbg,
unsigned char **pout,
int entropy, size_t min_len, size_t max_len)
{
size_t ret = 0;
RAND_POOL *pool;
struct {
void * instance;
int count;
} data;
memset(&data, 0, sizeof(data));
p... | null | 0 | size_t rand_drbg_get_nonce(RAND_DRBG *drbg,
unsigned char **pout,
int entropy, size_t min_len, size_t max_len)
{
size_t ret = 0;
RAND_POOL *pool;
struct {
void * instance;
int count;
} data;
memset(&data, 0, sizeof(data));
p... | @@ -26,8 +26,6 @@ static CRYPTO_RWLOCK *rand_meth_lock;
static const RAND_METHOD *default_RAND_meth;
static CRYPTO_ONCE rand_init = CRYPTO_ONCE_STATIC_INIT;
-int rand_fork_count;
-
static CRYPTO_RWLOCK *rand_nonce_lock;
static int rand_nonce_count;
@@ -303,11 +301,6 @@ void rand_drbg_cleanup_additional_data(RAN... | CWE-330 | null | null |
9,610 | int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key)
{
*key = OPENSSL_CRYPTO_THREAD_LOCAL_KEY_MAX + 1;
return 1;
}
| null | 0 | int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key)
{
*key = OPENSSL_CRYPTO_THREAD_LOCAL_KEY_MAX + 1;
return 1;
}
| @@ -12,6 +12,11 @@
#if !defined(OPENSSL_THREADS) || defined(CRYPTO_TDEBUG)
+# if defined(OPENSSL_SYS_UNIX)
+# include <sys/types.h>
+# include <unistd.h>
+# endif
+
CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
{
CRYPTO_RWLOCK *lock;
@@ -133,4 +138,12 @@ int openssl_init_fork_handlers(void)
return 0;
... | CWE-330 | null | null |
9,611 | int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b)
{
return (a == b);
}
| null | 0 | int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b)
{
return (a == b);
}
| @@ -12,6 +12,11 @@
#if !defined(OPENSSL_THREADS) || defined(CRYPTO_TDEBUG)
+# if defined(OPENSSL_SYS_UNIX)
+# include <sys/types.h>
+# include <unistd.h>
+# endif
+
CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
{
CRYPTO_RWLOCK *lock;
@@ -133,4 +138,12 @@ int openssl_init_fork_handlers(void)
return 0;
... | CWE-330 | null | null |
9,612 | CRYPTO_THREAD_ID CRYPTO_THREAD_get_current_id(void)
{
return 0;
}
| null | 0 | CRYPTO_THREAD_ID CRYPTO_THREAD_get_current_id(void)
{
return 0;
}
| @@ -12,6 +12,11 @@
#if !defined(OPENSSL_THREADS) || defined(CRYPTO_TDEBUG)
+# if defined(OPENSSL_SYS_UNIX)
+# include <sys/types.h>
+# include <unistd.h>
+# endif
+
CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
{
CRYPTO_RWLOCK *lock;
@@ -133,4 +138,12 @@ int openssl_init_fork_handlers(void)
return 0;
... | CWE-330 | null | null |
9,613 | void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key)
{
if (*key >= OPENSSL_CRYPTO_THREAD_LOCAL_KEY_MAX)
return NULL;
return thread_local_storage[*key];
}
| null | 0 | void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key)
{
if (*key >= OPENSSL_CRYPTO_THREAD_LOCAL_KEY_MAX)
return NULL;
return thread_local_storage[*key];
}
| @@ -12,6 +12,11 @@
#if !defined(OPENSSL_THREADS) || defined(CRYPTO_TDEBUG)
+# if defined(OPENSSL_SYS_UNIX)
+# include <sys/types.h>
+# include <unistd.h>
+# endif
+
CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
{
CRYPTO_RWLOCK *lock;
@@ -133,4 +138,12 @@ int openssl_init_fork_handlers(void)
return 0;
... | CWE-330 | null | null |
9,614 | int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *))
{
static unsigned int thread_local_key = 0;
if (thread_local_key >= OPENSSL_CRYPTO_THREAD_LOCAL_KEY_MAX)
return 0;
*key = thread_local_key++;
thread_local_storage[*key] = NULL;
return 1;
}
| null | 0 | int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *))
{
static unsigned int thread_local_key = 0;
if (thread_local_key >= OPENSSL_CRYPTO_THREAD_LOCAL_KEY_MAX)
return 0;
*key = thread_local_key++;
thread_local_storage[*key] = NULL;
return 1;
}
| @@ -12,6 +12,11 @@
#if !defined(OPENSSL_THREADS) || defined(CRYPTO_TDEBUG)
+# if defined(OPENSSL_SYS_UNIX)
+# include <sys/types.h>
+# include <unistd.h>
+# endif
+
CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
{
CRYPTO_RWLOCK *lock;
@@ -133,4 +138,12 @@ int openssl_init_fork_handlers(void)
return 0;
... | CWE-330 | null | null |
9,615 | void CRYPTO_THREAD_lock_free(CRYPTO_RWLOCK *lock) {
if (lock == NULL)
return;
*(unsigned int *)lock = 0;
OPENSSL_free(lock);
return;
}
| null | 0 | void CRYPTO_THREAD_lock_free(CRYPTO_RWLOCK *lock) {
if (lock == NULL)
return;
*(unsigned int *)lock = 0;
OPENSSL_free(lock);
return;
}
| @@ -12,6 +12,11 @@
#if !defined(OPENSSL_THREADS) || defined(CRYPTO_TDEBUG)
+# if defined(OPENSSL_SYS_UNIX)
+# include <sys/types.h>
+# include <unistd.h>
+# endif
+
CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
{
CRYPTO_RWLOCK *lock;
@@ -133,4 +138,12 @@ int openssl_init_fork_handlers(void)
return 0;
... | CWE-330 | null | null |
9,616 | CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
{
CRYPTO_RWLOCK *lock;
*(unsigned int *)lock = 1;
return lock;
}
| null | 0 | CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
{
CRYPTO_RWLOCK *lock;
*(unsigned int *)lock = 1;
return lock;
}
| @@ -12,6 +12,11 @@
#if !defined(OPENSSL_THREADS) || defined(CRYPTO_TDEBUG)
+# if defined(OPENSSL_SYS_UNIX)
+# include <sys/types.h>
+# include <unistd.h>
+# endif
+
CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
{
CRYPTO_RWLOCK *lock;
@@ -133,4 +138,12 @@ int openssl_init_fork_handlers(void)
return 0;
... | CWE-330 | null | null |
9,617 | int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock)
{
if (!ossl_assert(*(unsigned int *)lock == 1))
return 0;
return 1;
}
| null | 0 | int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock)
{
if (!ossl_assert(*(unsigned int *)lock == 1))
return 0;
return 1;
}
| @@ -12,6 +12,11 @@
#if !defined(OPENSSL_THREADS) || defined(CRYPTO_TDEBUG)
+# if defined(OPENSSL_SYS_UNIX)
+# include <sys/types.h>
+# include <unistd.h>
+# endif
+
CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
{
CRYPTO_RWLOCK *lock;
@@ -133,4 +138,12 @@ int openssl_init_fork_handlers(void)
return 0;
... | CWE-330 | null | null |
9,618 | int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
{
if (*once != 0)
return 1;
init();
*once = 1;
return 1;
}
| null | 0 | int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
{
if (*once != 0)
return 1;
init();
*once = 1;
return 1;
}
| @@ -12,6 +12,11 @@
#if !defined(OPENSSL_THREADS) || defined(CRYPTO_TDEBUG)
+# if defined(OPENSSL_SYS_UNIX)
+# include <sys/types.h>
+# include <unistd.h>
+# endif
+
CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
{
CRYPTO_RWLOCK *lock;
@@ -133,4 +138,12 @@ int openssl_init_fork_handlers(void)
return 0;
... | CWE-330 | null | null |
9,619 | int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val)
{
if (*key >= OPENSSL_CRYPTO_THREAD_LOCAL_KEY_MAX)
return 0;
thread_local_storage[*key] = val;
return 1;
}
| null | 0 | int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val)
{
if (*key >= OPENSSL_CRYPTO_THREAD_LOCAL_KEY_MAX)
return 0;
thread_local_storage[*key] = val;
return 1;
}
| @@ -12,6 +12,11 @@
#if !defined(OPENSSL_THREADS) || defined(CRYPTO_TDEBUG)
+# if defined(OPENSSL_SYS_UNIX)
+# include <sys/types.h>
+# include <unistd.h>
+# endif
+
CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
{
CRYPTO_RWLOCK *lock;
@@ -133,4 +138,12 @@ int openssl_init_fork_handlers(void)
return 0;
... | CWE-330 | null | null |
9,620 | int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock)
{
if (!ossl_assert(*(unsigned int *)lock == 1))
return 0;
return 1;
}
| null | 0 | int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock)
{
if (!ossl_assert(*(unsigned int *)lock == 1))
return 0;
return 1;
}
| @@ -12,6 +12,11 @@
#if !defined(OPENSSL_THREADS) || defined(CRYPTO_TDEBUG)
+# if defined(OPENSSL_SYS_UNIX)
+# include <sys/types.h>
+# include <unistd.h>
+# endif
+
CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
{
CRYPTO_RWLOCK *lock;
@@ -133,4 +138,12 @@ int openssl_init_fork_handlers(void)
return 0;
... | CWE-330 | null | null |
9,621 | int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
{
*val += amount;
*ret = *val;
return 1;
}
| null | 0 | int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
{
*val += amount;
*ret = *val;
return 1;
}
| @@ -12,6 +12,11 @@
#if !defined(OPENSSL_THREADS) || defined(CRYPTO_TDEBUG)
+# if defined(OPENSSL_SYS_UNIX)
+# include <sys/types.h>
+# include <unistd.h>
+# endif
+
CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
{
CRYPTO_RWLOCK *lock;
@@ -133,4 +138,12 @@ int openssl_init_fork_handlers(void)
return 0;
... | CWE-330 | null | null |
9,622 | int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key)
{
if (TlsFree(*key) == 0)
return 0;
return 1;
}
| null | 0 | int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key)
{
if (TlsFree(*key) == 0)
return 0;
return 1;
}
| @@ -164,4 +164,8 @@ int openssl_init_fork_handlers(void)
return 0;
}
+int openssl_get_fork_id(void)
+{
+ return 0;
+}
#endif | CWE-330 | null | null |
9,623 | void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key)
{
DWORD last_error;
void *ret;
/*
* TlsGetValue clears the last error even on success, so that callers may
* distinguish it successfully returning NULL or failing. It is documented
* to never fail if the argument is a valid index from T... | null | 0 | void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key)
{
DWORD last_error;
void *ret;
/*
* TlsGetValue clears the last error even on success, so that callers may
* distinguish it successfully returning NULL or failing. It is documented
* to never fail if the argument is a valid index from T... | @@ -164,4 +164,8 @@ int openssl_init_fork_handlers(void)
return 0;
}
+int openssl_get_fork_id(void)
+{
+ return 0;
+}
#endif | CWE-330 | null | null |
9,624 | void CRYPTO_THREAD_lock_free(CRYPTO_RWLOCK *lock)
{
if (lock == NULL)
return;
DeleteCriticalSection(lock);
OPENSSL_free(lock);
return;
}
| null | 0 | void CRYPTO_THREAD_lock_free(CRYPTO_RWLOCK *lock)
{
if (lock == NULL)
return;
DeleteCriticalSection(lock);
OPENSSL_free(lock);
return;
}
| @@ -164,4 +164,8 @@ int openssl_init_fork_handlers(void)
return 0;
}
+int openssl_get_fork_id(void)
+{
+ return 0;
+}
#endif | CWE-330 | null | null |
9,625 | CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
{
CRYPTO_RWLOCK *lock;
if ((lock = OPENSSL_zalloc(sizeof(CRITICAL_SECTION))) == NULL) {
/* Don't set error, to avoid recursion blowup. */
return NULL;
}
#if !defined(_WIN32_WCE)
/* 0x400 is the spin count value suggested in the documentation ... | null | 0 | CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
{
CRYPTO_RWLOCK *lock;
if ((lock = OPENSSL_zalloc(sizeof(CRITICAL_SECTION))) == NULL) {
/* Don't set error, to avoid recursion blowup. */
return NULL;
}
#if !defined(_WIN32_WCE)
/* 0x400 is the spin count value suggested in the documentation ... | @@ -164,4 +164,8 @@ int openssl_init_fork_handlers(void)
return 0;
}
+int openssl_get_fork_id(void)
+{
+ return 0;
+}
#endif | CWE-330 | null | null |
9,626 | int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
{
LONG volatile *lock = (LONG *)once;
LONG result;
if (*lock == ONCE_DONE)
return 1;
do {
result = InterlockedCompareExchange(lock, ONCE_ININIT, ONCE_UNINITED);
if (result == ONCE_UNINITED) {
init();
... | null | 0 | int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
{
LONG volatile *lock = (LONG *)once;
LONG result;
if (*lock == ONCE_DONE)
return 1;
do {
result = InterlockedCompareExchange(lock, ONCE_ININIT, ONCE_UNINITED);
if (result == ONCE_UNINITED) {
init();
... | @@ -164,4 +164,8 @@ int openssl_init_fork_handlers(void)
return 0;
}
+int openssl_get_fork_id(void)
+{
+ return 0;
+}
#endif | CWE-330 | null | null |
9,627 | int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val)
{
if (TlsSetValue(*key, val) == 0)
return 0;
return 1;
}
| null | 0 | int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val)
{
if (TlsSetValue(*key, val) == 0)
return 0;
return 1;
}
| @@ -164,4 +164,8 @@ int openssl_init_fork_handlers(void)
return 0;
}
+int openssl_get_fork_id(void)
+{
+ return 0;
+}
#endif | CWE-330 | null | null |
9,628 | int CRYPTO_THREAD_unlock(CRYPTO_RWLOCK *lock)
{
LeaveCriticalSection(lock);
return 1;
}
| null | 0 | int CRYPTO_THREAD_unlock(CRYPTO_RWLOCK *lock)
{
LeaveCriticalSection(lock);
return 1;
}
| @@ -164,4 +164,8 @@ int openssl_init_fork_handlers(void)
return 0;
}
+int openssl_get_fork_id(void)
+{
+ return 0;
+}
#endif | CWE-330 | null | null |
9,629 | int openssl_init_fork_handlers(void)
{
return 0;
}
| null | 0 | int openssl_init_fork_handlers(void)
{
return 0;
}
| @@ -164,4 +164,8 @@ int openssl_init_fork_handlers(void)
return 0;
}
+int openssl_get_fork_id(void)
+{
+ return 0;
+}
#endif | CWE-330 | null | null |
9,630 | void ERR_load_EC_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(EC_str_functs[0].error) == NULL) {
ERR_load_strings(0, EC_str_functs);
ERR_load_strings(0, EC_str_reasons);
}
#endif
}
| null | 0 | void ERR_load_EC_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(EC_str_functs[0].error) == NULL) {
ERR_load_strings(0, EC_str_functs);
ERR_load_strings(0, EC_str_reasons);
}
#endif
}
| @@ -1,6 +1,6 @@
/* crypto/ec/ec_err.c */
/* ====================================================================
- * Copyright (c) 1999-2015 The OpenSSL Project. All rights reserved.
+ * Copyright (c) 1999-2019 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with... | CWE-311 | null | null |
9,631 | void EC_GROUP_clear_free(EC_GROUP *group)
{
if (!group)
return;
if (group->meth->group_clear_finish != 0)
group->meth->group_clear_finish(group);
else if (group->meth->group_finish != 0)
group->meth->group_finish(group);
EC_EX_DATA_clear_free_all_data(&group->extra_data);
... | null | 0 | void EC_GROUP_clear_free(EC_GROUP *group)
{
if (!group)
return;
if (group->meth->group_clear_finish != 0)
group->meth->group_clear_finish(group);
else if (group->meth->group_finish != 0)
group->meth->group_finish(group);
EC_EX_DATA_clear_free_all_data(&group->extra_data);
... | @@ -294,6 +294,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
return meth->field_type;
}
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q)
+ ... | CWE-311 | null | null |
9,632 | int EC_GROUP_copy(EC_GROUP *dest, const EC_GROUP *src)
{
EC_EXTRA_DATA *d;
if (dest->meth->group_copy == 0) {
ECerr(EC_F_EC_GROUP_COPY, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
if (dest->meth != src->meth) {
ECerr(EC_F_EC_GROUP_COPY, EC_R_INCOMPATIBLE_OBJECTS);
re... | null | 0 | int EC_GROUP_copy(EC_GROUP *dest, const EC_GROUP *src)
{
EC_EXTRA_DATA *d;
if (dest->meth->group_copy == 0) {
ECerr(EC_F_EC_GROUP_COPY, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
if (dest->meth != src->meth) {
ECerr(EC_F_EC_GROUP_COPY, EC_R_INCOMPATIBLE_OBJECTS);
re... | @@ -294,6 +294,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
return meth->field_type;
}
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q)
+ ... | CWE-311 | null | null |
9,633 | EC_GROUP *EC_GROUP_dup(const EC_GROUP *a)
{
EC_GROUP *t = NULL;
int ok = 0;
if (a == NULL)
return NULL;
if ((t = EC_GROUP_new(a->meth)) == NULL)
return (NULL);
if (!EC_GROUP_copy(t, a))
goto err;
ok = 1;
err:
if (!ok) {
if (t)
EC_GROUP_free(t)... | null | 0 | EC_GROUP *EC_GROUP_dup(const EC_GROUP *a)
{
EC_GROUP *t = NULL;
int ok = 0;
if (a == NULL)
return NULL;
if ((t = EC_GROUP_new(a->meth)) == NULL)
return (NULL);
if (!EC_GROUP_copy(t, a))
goto err;
ok = 1;
err:
if (!ok) {
if (t)
EC_GROUP_free(t)... | @@ -294,6 +294,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
return meth->field_type;
}
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q)
+ ... | CWE-311 | null | null |
9,634 | void EC_GROUP_free(EC_GROUP *group)
{
if (!group)
return;
if (group->meth->group_finish != 0)
group->meth->group_finish(group);
EC_EX_DATA_free_all_data(&group->extra_data);
if (EC_GROUP_VERSION(group) && group->mont_data)
BN_MONT_CTX_free(group->mont_data);
if (group->ge... | null | 0 | void EC_GROUP_free(EC_GROUP *group)
{
if (!group)
return;
if (group->meth->group_finish != 0)
group->meth->group_finish(group);
EC_EX_DATA_free_all_data(&group->extra_data);
if (EC_GROUP_VERSION(group) && group->mont_data)
BN_MONT_CTX_free(group->mont_data);
if (group->ge... | @@ -294,6 +294,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
return meth->field_type;
}
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q)
+ ... | CWE-311 | null | null |
9,635 | const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group)
{
return group->meth;
}
| null | 0 | const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group)
{
return group->meth;
}
| @@ -294,6 +294,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
return meth->field_type;
}
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q)
+ ... | CWE-311 | null | null |
9,636 | EC_GROUP *EC_GROUP_new(const EC_METHOD *meth)
{
EC_GROUP *ret;
if (meth == NULL) {
ECerr(EC_F_EC_GROUP_NEW, EC_R_SLOT_FULL);
return NULL;
}
if (meth->group_init == 0) {
ECerr(EC_F_EC_GROUP_NEW, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return NULL;
}
ret = OPENSSL_mal... | null | 0 | EC_GROUP *EC_GROUP_new(const EC_METHOD *meth)
{
EC_GROUP *ret;
if (meth == NULL) {
ECerr(EC_F_EC_GROUP_NEW, EC_R_SLOT_FULL);
return NULL;
}
if (meth->group_init == 0) {
ECerr(EC_F_EC_GROUP_NEW, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return NULL;
}
ret = OPENSSL_mal... | @@ -294,6 +294,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
return meth->field_type;
}
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q)
+ ... | CWE-311 | null | null |
9,637 | int EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx)
{
if (group->meth->mul == 0)
/* use default */
return ec_wNAF_precompute_mult(group, ctx);
if (group->meth->precompute_mult != 0)
return group->meth->precompute_mult(group, ctx);
else
return 1; /* nothi... | null | 0 | int EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx)
{
if (group->meth->mul == 0)
/* use default */
return ec_wNAF_precompute_mult(group, ctx);
if (group->meth->precompute_mult != 0)
return group->meth->precompute_mult(group, ctx);
else
return 1; /* nothi... | @@ -294,6 +294,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
return meth->field_type;
}
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q)
+ ... | CWE-311 | null | null |
9,638 | int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,
const BIGNUM *order, const BIGNUM *cofactor)
{
return !BN_is_zero(order);
return 0;
}
| null | 0 | int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,
const BIGNUM *order, const BIGNUM *cofactor)
{
return !BN_is_zero(order);
return 0;
}
| @@ -294,6 +294,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
return meth->field_type;
}
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q)
+ ... | CWE-311 | null | null |
9,639 | int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
const EC_POINT *b, BN_CTX *ctx)
{
if (group->meth->add == 0) {
ECerr(EC_F_EC_POINT_ADD, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
if ((group->meth != r->meth) || (r->meth != a->meth)
|| (a-... | null | 0 | int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
const EC_POINT *b, BN_CTX *ctx)
{
if (group->meth->add == 0) {
ECerr(EC_F_EC_POINT_ADD, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
if ((group->meth != r->meth) || (r->meth != a->meth)
|| (a-... | @@ -294,6 +294,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
return meth->field_type;
}
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q)
+ ... | CWE-311 | null | null |
9,640 | int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
BN_CTX *ctx)
{
if (group->meth->dbl == 0) {
ECerr(EC_F_EC_POINT_DBL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
if ((group->meth != r->meth) || (r->meth != a->meth)) {
ECerr(EC_F_EC_POINT_DB... | null | 0 | int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
BN_CTX *ctx)
{
if (group->meth->dbl == 0) {
ECerr(EC_F_EC_POINT_DBL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
if ((group->meth != r->meth) || (r->meth != a->meth)) {
ECerr(EC_F_EC_POINT_DB... | @@ -294,6 +294,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
return meth->field_type;
}
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q)
+ ... | CWE-311 | null | null |
9,641 | int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group,
const EC_POINT *point, BIGNUM *x,
BIGNUM *y, BN_CTX *ctx)
{
if (group->meth->point_get_affine_coordinates == 0) {
ECerr(EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M,... | null | 0 | int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group,
const EC_POINT *point, BIGNUM *x,
BIGNUM *y, BN_CTX *ctx)
{
if (group->meth->point_get_affine_coordinates == 0) {
ECerr(EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M,... | @@ -294,6 +294,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
return meth->field_type;
}
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q)
+ ... | CWE-311 | null | null |
9,642 | int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group,
const EC_POINT *point, BIGNUM *x,
BIGNUM *y, BN_CTX *ctx)
{
if (group->meth->point_get_affine_coordinates == 0) {
ECerr(EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP,
... | null | 0 | int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group,
const EC_POINT *point, BIGNUM *x,
BIGNUM *y, BN_CTX *ctx)
{
if (group->meth->point_get_affine_coordinates == 0) {
ECerr(EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP,
... | @@ -294,6 +294,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
return meth->field_type;
}
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q)
+ ... | CWE-311 | null | null |
9,643 | int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx)
{
if (group->meth->invert == 0) {
ECerr(EC_F_EC_POINT_INVERT, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
if (group->meth != a->meth) {
ECerr(EC_F_EC_POINT_INVERT, EC_R_INCOMPATIBLE_OBJECTS);
return 0;
... | null | 0 | int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx)
{
if (group->meth->invert == 0) {
ECerr(EC_F_EC_POINT_INVERT, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
if (group->meth != a->meth) {
ECerr(EC_F_EC_POINT_INVERT, EC_R_INCOMPATIBLE_OBJECTS);
return 0;
... | @@ -294,6 +294,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
return meth->field_type;
}
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q)
+ ... | CWE-311 | null | null |
9,644 | int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *point)
{
if (group->meth->is_at_infinity == 0) {
ECerr(EC_F_EC_POINT_IS_AT_INFINITY,
ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
if (group->meth != point->meth) {
ECerr(EC_F_EC_POINT_IS_AT_INFINITY, ... | null | 0 | int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *point)
{
if (group->meth->is_at_infinity == 0) {
ECerr(EC_F_EC_POINT_IS_AT_INFINITY,
ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
if (group->meth != point->meth) {
ECerr(EC_F_EC_POINT_IS_AT_INFINITY, ... | @@ -294,6 +294,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
return meth->field_type;
}
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q)
+ ... | CWE-311 | null | null |
9,645 | int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point,
BN_CTX *ctx)
{
if (group->meth->is_on_curve == 0) {
ECerr(EC_F_EC_POINT_IS_ON_CURVE, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
if (group->meth != point->meth) {
ECerr(EC_F_EC_POINT_I... | null | 0 | int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point,
BN_CTX *ctx)
{
if (group->meth->is_on_curve == 0) {
ECerr(EC_F_EC_POINT_IS_ON_CURVE, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
if (group->meth != point->meth) {
ECerr(EC_F_EC_POINT_I... | @@ -294,6 +294,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
return meth->field_type;
}
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q)
+ ... | CWE-311 | null | null |
9,646 | int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx)
{
if (group->meth->make_affine == 0) {
ECerr(EC_F_EC_POINT_MAKE_AFFINE, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
if (group->meth != point->meth) {
ECerr(EC_F_EC_POINT_MAKE_AFFINE, EC_R_INCOMPATIBLE_O... | null | 0 | int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx)
{
if (group->meth->make_affine == 0) {
ECerr(EC_F_EC_POINT_MAKE_AFFINE, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
if (group->meth != point->meth) {
ECerr(EC_F_EC_POINT_MAKE_AFFINE, EC_R_INCOMPATIBLE_O... | @@ -294,6 +294,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
return meth->field_type;
}
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q)
+ ... | CWE-311 | null | null |
9,647 | int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar,
const EC_POINT *point, const BIGNUM *p_scalar, BN_CTX *ctx)
{
/* just a convenient interface to EC_POINTs_mul() */
const EC_POINT *points[1];
const BIGNUM *scalars[1];
points[0] = point;
scalars[0] = p_sc... | null | 0 | int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar,
const EC_POINT *point, const BIGNUM *p_scalar, BN_CTX *ctx)
{
/* just a convenient interface to EC_POINTs_mul() */
const EC_POINT *points[1];
const BIGNUM *scalars[1];
points[0] = point;
scalars[0] = p_sc... | @@ -294,6 +294,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
return meth->field_type;
}
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q)
+ ... | CWE-311 | null | null |
9,648 | int EC_POINTs_make_affine(const EC_GROUP *group, size_t num,
EC_POINT *points[], BN_CTX *ctx)
{
size_t i;
if (group->meth->points_make_affine == 0) {
ECerr(EC_F_EC_POINTS_MAKE_AFFINE, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
for (i = 0; i < num; i++) {
... | null | 0 | int EC_POINTs_make_affine(const EC_GROUP *group, size_t num,
EC_POINT *points[], BN_CTX *ctx)
{
size_t i;
if (group->meth->points_make_affine == 0) {
ECerr(EC_F_EC_POINTS_MAKE_AFFINE, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
for (i = 0; i < num; i++) {
... | @@ -294,6 +294,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
return meth->field_type;
}
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q)
+ ... | CWE-311 | null | null |
9,649 | int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
size_t num, const EC_POINT *points[],
const BIGNUM *scalars[], BN_CTX *ctx)
{
if (group->meth->mul == 0)
/* use default */
return ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx);
... | null | 0 | int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
size_t num, const EC_POINT *points[],
const BIGNUM *scalars[], BN_CTX *ctx)
{
if (group->meth->mul == 0)
/* use default */
return ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx);
... | @@ -294,6 +294,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
return meth->field_type;
}
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q)
+ ... | CWE-311 | null | null |
9,650 | int ERR_load_EC_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(EC_str_functs[0].error) == NULL) {
ERR_load_strings(0, EC_str_functs);
ERR_load_strings(0, EC_str_reasons);
}
#endif
return 1;
}
| null | 0 | int ERR_load_EC_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(EC_str_functs[0].error) == NULL) {
ERR_load_strings(0, EC_str_functs);
ERR_load_strings(0, EC_str_reasons);
}
#endif
return 1;
}
| @@ -273,6 +273,7 @@ static ERR_STRING_DATA EC_str_reasons[] = {
{ERR_REASON(EC_R_SLOT_FULL), "slot full"},
{ERR_REASON(EC_R_UNDEFINED_GENERATOR), "undefined generator"},
{ERR_REASON(EC_R_UNDEFINED_ORDER), "undefined order"},
+ {ERR_REASON(EC_R_UNKNOWN_COFACTOR), "unknown cofactor"},
{ERR_REASON(E... | CWE-311 | null | null |
9,651 | int EC_GROUP_copy(EC_GROUP *dest, const EC_GROUP *src)
{
if (dest->meth->group_copy == 0) {
ECerr(EC_F_EC_GROUP_COPY, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
if (dest->meth != src->meth) {
ECerr(EC_F_EC_GROUP_COPY, EC_R_INCOMPATIBLE_OBJECTS);
return 0;
}
if (d... | null | 0 | int EC_GROUP_copy(EC_GROUP *dest, const EC_GROUP *src)
{
if (dest->meth->group_copy == 0) {
ECerr(EC_F_EC_GROUP_COPY, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
if (dest->meth != src->meth) {
ECerr(EC_F_EC_GROUP_COPY, EC_R_INCOMPATIBLE_OBJECTS);
return 0;
}
if (d... | @@ -257,6 +257,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
return meth->field_type;
}
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q)
+ ... | CWE-311 | null | null |
9,652 | EC_GROUP *EC_GROUP_dup(const EC_GROUP *a)
{
EC_GROUP *t = NULL;
int ok = 0;
if (a == NULL)
return NULL;
if ((t = EC_GROUP_new(a->meth)) == NULL)
return (NULL);
if (!EC_GROUP_copy(t, a))
goto err;
ok = 1;
err:
if (!ok) {
EC_GROUP_free(t);
return NU... | null | 0 | EC_GROUP *EC_GROUP_dup(const EC_GROUP *a)
{
EC_GROUP *t = NULL;
int ok = 0;
if (a == NULL)
return NULL;
if ((t = EC_GROUP_new(a->meth)) == NULL)
return (NULL);
if (!EC_GROUP_copy(t, a))
goto err;
ok = 1;
err:
if (!ok) {
EC_GROUP_free(t);
return NU... | @@ -257,6 +257,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
return meth->field_type;
}
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q)
+ ... | CWE-311 | null | null |
9,653 | void EC_GROUP_free(EC_GROUP *group)
{
if (!group)
return;
if (group->meth->group_finish != 0)
group->meth->group_finish(group);
EC_pre_comp_free(group);
BN_MONT_CTX_free(group->mont_data);
EC_POINT_free(group->generator);
BN_free(group->order);
BN_free(group->cofactor);
... | null | 0 | void EC_GROUP_free(EC_GROUP *group)
{
if (!group)
return;
if (group->meth->group_finish != 0)
group->meth->group_finish(group);
EC_pre_comp_free(group);
BN_MONT_CTX_free(group->mont_data);
EC_POINT_free(group->generator);
BN_free(group->order);
BN_free(group->cofactor);
... | @@ -257,6 +257,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
return meth->field_type;
}
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q)
+ ... | CWE-311 | null | null |
9,654 | int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,
const BIGNUM *order, const BIGNUM *cofactor)
{
return group->order;
}
| null | 0 | int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,
const BIGNUM *order, const BIGNUM *cofactor)
{
return group->order;
}
| @@ -257,6 +257,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
return meth->field_type;
}
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q)
+ ... | CWE-311 | null | null |
9,655 | void EC_pre_comp_free(EC_GROUP *group)
{
switch (group->pre_comp_type) {
default:
break;
#ifdef ECP_NISTZ256_REFERENCE_IMPLEMENTATION
case PCT_nistz256:
EC_nistz256_pre_comp_free(group->pre_comp.nistz256);
break;
#endif
#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
case PCT_nistp224:
... | null | 0 | void EC_pre_comp_free(EC_GROUP *group)
{
switch (group->pre_comp_type) {
default:
break;
#ifdef ECP_NISTZ256_REFERENCE_IMPLEMENTATION
case PCT_nistz256:
EC_nistz256_pre_comp_free(group->pre_comp.nistz256);
break;
#endif
#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
case PCT_nistp224:
... | @@ -257,6 +257,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
return meth->field_type;
}
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q + 1 + 2*sqrt(q)
+ ... | CWE-311 | null | null |
9,656 | int EC_GROUP_copy(EC_GROUP *dest, const EC_GROUP *src)
{
if (dest->meth->group_copy == 0) {
ECerr(EC_F_EC_GROUP_COPY, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
if (dest->meth != src->meth) {
ECerr(EC_F_EC_GROUP_COPY, EC_R_INCOMPATIBLE_OBJECTS);
return 0;
}
if (d... | null | 0 | int EC_GROUP_copy(EC_GROUP *dest, const EC_GROUP *src)
{
if (dest->meth->group_copy == 0) {
ECerr(EC_F_EC_GROUP_COPY, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
if (dest->meth != src->meth) {
ECerr(EC_F_EC_GROUP_COPY, EC_R_INCOMPATIBLE_OBJECTS);
return 0;
}
if (d... | @@ -265,6 +265,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
static int ec_precompute_mont_data(EC_GROUP *);
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q ... | CWE-311 | null | null |
9,657 | EC_GROUP *EC_GROUP_dup(const EC_GROUP *a)
{
EC_GROUP *t = NULL;
int ok = 0;
if (a == NULL)
return NULL;
if ((t = EC_GROUP_new(a->meth)) == NULL)
return NULL;
if (!EC_GROUP_copy(t, a))
goto err;
ok = 1;
err:
if (!ok) {
EC_GROUP_free(t);
return NULL... | null | 0 | EC_GROUP *EC_GROUP_dup(const EC_GROUP *a)
{
EC_GROUP *t = NULL;
int ok = 0;
if (a == NULL)
return NULL;
if ((t = EC_GROUP_new(a->meth)) == NULL)
return NULL;
if (!EC_GROUP_copy(t, a))
goto err;
ok = 1;
err:
if (!ok) {
EC_GROUP_free(t);
return NULL... | @@ -265,6 +265,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
static int ec_precompute_mont_data(EC_GROUP *);
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q ... | CWE-311 | null | null |
9,658 | int EC_METHOD_get_field_type(const EC_METHOD *meth)
{
return meth->field_type;
}
| null | 0 | int EC_METHOD_get_field_type(const EC_METHOD *meth)
{
return meth->field_type;
}
| @@ -265,6 +265,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
static int ec_precompute_mont_data(EC_GROUP *);
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q ... | CWE-311 | null | null |
9,659 | void EC_pre_comp_free(EC_GROUP *group)
{
switch (group->pre_comp_type) {
case PCT_none:
break;
case PCT_nistz256:
#ifdef ECP_NISTZ256_ASM
EC_nistz256_pre_comp_free(group->pre_comp.nistz256);
#endif
break;
#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
case PCT_nistp224:
EC_nistp2... | null | 0 | void EC_pre_comp_free(EC_GROUP *group)
{
switch (group->pre_comp_type) {
case PCT_none:
break;
case PCT_nistz256:
#ifdef ECP_NISTZ256_ASM
EC_nistz256_pre_comp_free(group->pre_comp.nistz256);
#endif
break;
#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
case PCT_nistp224:
EC_nistp2... | @@ -265,6 +265,67 @@ int EC_METHOD_get_field_type(const EC_METHOD *meth)
static int ec_precompute_mont_data(EC_GROUP *);
+/*-
+ * Try computing cofactor from the generator order (n) and field cardinality (q).
+ * This works for all curves of cryptographic interest.
+ *
+ * Hasse thm: q + 1 - 2*sqrt(q) <= n*h <= q ... | CWE-311 | null | null |
9,660 | _gnutls_decrypt (gnutls_session_t session, opaque * ciphertext,
size_t ciphertext_size, uint8_t * data,
size_t max_data_size, content_type_t type)
{
gnutls_datum_t gtxt;
gnutls_datum_t gcipher;
int ret;
if (ciphertext_size == 0)
return 0;
gcipher.size = ciphertext_size;
gcipher.data = ciphertext... | DoS | 0 | _gnutls_decrypt (gnutls_session_t session, opaque * ciphertext,
size_t ciphertext_size, uint8_t * data,
size_t max_data_size, content_type_t type)
{
gnutls_datum_t gtxt;
gnutls_datum_t gcipher;
int ret;
if (ciphertext_size == 0)
return 0;
gcipher.size = ciphertext_size;
gcipher.data = ciphertext... | @@ -459,6 +459,14 @@ _gnutls_ciphertext2compressed (gnutls_session_t session,
return GNUTLS_E_INTERNAL_ERROR;
}
+ if (ciphertext.size < (unsigned) blocksize + hash_size)
+ {
+ _gnutls_record_log
+ ("REC[%x]: Short record length %d < %d + %d (under attack?)\n",
+ session, ciphertext.s... | CWE-189 | null | null |
9,661 | _gnutls_encrypt (gnutls_session_t session, const opaque * headers,
size_t headers_size, const opaque * data,
size_t data_size, opaque * ciphertext,
size_t ciphertext_size, content_type_t type, int random_pad)
{
gnutls_datum_t plain;
gnutls_datum_t comp;
int ret;
int free_comp = 1;
plain.data = (opaq... | DoS | 0 | _gnutls_encrypt (gnutls_session_t session, const opaque * headers,
size_t headers_size, const opaque * data,
size_t data_size, opaque * ciphertext,
size_t ciphertext_size, content_type_t type, int random_pad)
{
gnutls_datum_t plain;
gnutls_datum_t comp;
int ret;
int free_comp = 1;
plain.data = (opaq... | @@ -459,6 +459,14 @@ _gnutls_ciphertext2compressed (gnutls_session_t session,
return GNUTLS_E_INTERNAL_ERROR;
}
+ if (ciphertext.size < (unsigned) blocksize + hash_size)
+ {
+ _gnutls_record_log
+ ("REC[%x]: Short record length %d < %d + %d (under attack?)\n",
+ session, ciphertext.s... | CWE-189 | null | null |
9,662 | calc_enc_length (gnutls_session_t session, int data_size,
int hash_size, uint8_t * pad, int random_pad,
cipher_type_t block_algo, uint16_t blocksize)
{
uint8_t rnd;
int length, ret;
*pad = 0;
switch (block_algo)
{
case CIPHER_STREAM:
length = data_size + hash_size;
break;
case C... | DoS | 0 | calc_enc_length (gnutls_session_t session, int data_size,
int hash_size, uint8_t * pad, int random_pad,
cipher_type_t block_algo, uint16_t blocksize)
{
uint8_t rnd;
int length, ret;
*pad = 0;
switch (block_algo)
{
case CIPHER_STREAM:
length = data_size + hash_size;
break;
case C... | @@ -459,6 +459,14 @@ _gnutls_ciphertext2compressed (gnutls_session_t session,
return GNUTLS_E_INTERNAL_ERROR;
}
+ if (ciphertext.size < (unsigned) blocksize + hash_size)
+ {
+ _gnutls_record_log
+ ("REC[%x]: Short record length %d < %d + %d (under attack?)\n",
+ session, ciphertext.s... | CWE-189 | null | null |
9,663 | is_read_comp_null (gnutls_session_t session)
{
if (session->security_parameters.read_compression_algorithm ==
GNUTLS_COMP_NULL)
return 0;
return 1;
}
| DoS | 0 | is_read_comp_null (gnutls_session_t session)
{
if (session->security_parameters.read_compression_algorithm ==
GNUTLS_COMP_NULL)
return 0;
return 1;
}
| @@ -459,6 +459,14 @@ _gnutls_ciphertext2compressed (gnutls_session_t session,
return GNUTLS_E_INTERNAL_ERROR;
}
+ if (ciphertext.size < (unsigned) blocksize + hash_size)
+ {
+ _gnutls_record_log
+ ("REC[%x]: Short record length %d < %d + %d (under attack?)\n",
+ session, ciphertext.s... | CWE-189 | null | null |
9,664 | is_write_comp_null (gnutls_session_t session)
{
if (session->security_parameters.write_compression_algorithm ==
GNUTLS_COMP_NULL)
return 0;
return 1;
}
| DoS | 0 | is_write_comp_null (gnutls_session_t session)
{
if (session->security_parameters.write_compression_algorithm ==
GNUTLS_COMP_NULL)
return 0;
return 1;
}
| @@ -459,6 +459,14 @@ _gnutls_ciphertext2compressed (gnutls_session_t session,
return GNUTLS_E_INTERNAL_ERROR;
}
+ if (ciphertext.size < (unsigned) blocksize + hash_size)
+ {
+ _gnutls_record_log
+ ("REC[%x]: Short record length %d < %d + %d (under attack?)\n",
+ session, ciphertext.s... | CWE-189 | null | null |
9,665 | mac_deinit (digest_hd_st *td, opaque * res, int ver)
{
if (ver == GNUTLS_SSL3)
{ /* SSL 3.0 */
_gnutls_mac_deinit_ssl3 (td, res);
}
else
{
_gnutls_hmac_deinit (td, res);
}
}
| DoS | 0 | mac_deinit (digest_hd_st *td, opaque * res, int ver)
{
if (ver == GNUTLS_SSL3)
{ /* SSL 3.0 */
_gnutls_mac_deinit_ssl3 (td, res);
}
else
{
_gnutls_hmac_deinit (td, res);
}
}
| @@ -459,6 +459,14 @@ _gnutls_ciphertext2compressed (gnutls_session_t session,
return GNUTLS_E_INTERNAL_ERROR;
}
+ if (ciphertext.size < (unsigned) blocksize + hash_size)
+ {
+ _gnutls_record_log
+ ("REC[%x]: Short record length %d < %d + %d (under attack?)\n",
+ session, ciphertext.s... | CWE-189 | null | null |
9,666 | mac_init (digest_hd_st* td, gnutls_mac_algorithm_t mac, opaque * secret, int secret_size,
int ver)
{
int ret = 0;
if (mac == GNUTLS_MAC_NULL)
{
gnutls_assert();
return GNUTLS_E_HASH_FAILED;
}
if (ver == GNUTLS_SSL3)
{ /* SSL 3.0 */
ret = _gnutls_mac_init_ssl3 (td, mac, secret,... | DoS | 0 | mac_init (digest_hd_st* td, gnutls_mac_algorithm_t mac, opaque * secret, int secret_size,
int ver)
{
int ret = 0;
if (mac == GNUTLS_MAC_NULL)
{
gnutls_assert();
return GNUTLS_E_HASH_FAILED;
}
if (ver == GNUTLS_SSL3)
{ /* SSL 3.0 */
ret = _gnutls_mac_init_ssl3 (td, mac, secret,... | @@ -459,6 +459,14 @@ _gnutls_ciphertext2compressed (gnutls_session_t session,
return GNUTLS_E_INTERNAL_ERROR;
}
+ if (ciphertext.size < (unsigned) blocksize + hash_size)
+ {
+ _gnutls_record_log
+ ("REC[%x]: Short record length %d < %d + %d (under attack?)\n",
+ session, ciphertext.s... | CWE-189 | null | null |
9,667 | _gnutls_finished (gnutls_session_t session, int type, void *ret)
{
const int siz = TLS_MSG_LEN;
opaque concat[36];
size_t len;
const char *mesg;
digest_hd_st td_md5;
digest_hd_st td_sha;
gnutls_protocol_t ver = gnutls_protocol_get_version (session);
int rc;
if (ver < GNUTLS_TLS1_2)
{
rc = _... | DoS | 0 | _gnutls_finished (gnutls_session_t session, int type, void *ret)
{
const int siz = TLS_MSG_LEN;
opaque concat[36];
size_t len;
const char *mesg;
digest_hd_st td_md5;
digest_hd_st td_sha;
gnutls_protocol_t ver = gnutls_protocol_get_version (session);
int rc;
if (ver < GNUTLS_TLS1_2)
{
rc = _... | @@ -1003,6 +1003,14 @@ _gnutls_recv_handshake_header (gnutls_session_t session,
*recv_type = session->internals.handshake_header_buffer.recv_type;
+ if (*recv_type != type)
+ {
+ gnutls_assert ();
+ _gnutls_handshake_log
+ ("HSK[%x]: Handshake type mismatch (under attack?... | CWE-189 | null | null |
9,668 | _gnutls_handshake_hash_pending (gnutls_session_t session)
{
size_t siz;
int ret;
opaque *data;
if (session->internals.handshake_mac_handle_init == 0)
{
gnutls_assert ();
return GNUTLS_E_INTERNAL_ERROR;
}
/* We check if there are pending data to hash.
*/
if ((ret = _gnutls_handshake_... | DoS | 0 | _gnutls_handshake_hash_pending (gnutls_session_t session)
{
size_t siz;
int ret;
opaque *data;
if (session->internals.handshake_mac_handle_init == 0)
{
gnutls_assert ();
return GNUTLS_E_INTERNAL_ERROR;
}
/* We check if there are pending data to hash.
*/
if ((ret = _gnutls_handshake_... | @@ -1003,6 +1003,14 @@ _gnutls_recv_handshake_header (gnutls_session_t session,
*recv_type = session->internals.handshake_header_buffer.recv_type;
+ if (*recv_type != type)
+ {
+ gnutls_assert ();
+ _gnutls_handshake_log
+ ("HSK[%x]: Handshake type mismatch (under attack?... | CWE-189 | null | null |
9,669 | int _gnutls_negotiate_version( gnutls_session_t session, gnutls_protocol_t adv_version)
{
int ret;
/* if we do not support that version */
if (_gnutls_version_is_supported (session, adv_version) == 0)
{
/* If he requested something we do not support
* then we send him the highest we support.
... | DoS | 0 | int _gnutls_negotiate_version( gnutls_session_t session, gnutls_protocol_t adv_version)
{
int ret;
/* if we do not support that version */
if (_gnutls_version_is_supported (session, adv_version) == 0)
{
/* If he requested something we do not support
* then we send him the highest we support.
... | @@ -1003,6 +1003,14 @@ _gnutls_recv_handshake_header (gnutls_session_t session,
*recv_type = session->internals.handshake_header_buffer.recv_type;
+ if (*recv_type != type)
+ {
+ gnutls_assert ();
+ _gnutls_handshake_log
+ ("HSK[%x]: Handshake type mismatch (under attack?... | CWE-189 | null | null |
9,670 | _gnutls_read_client_hello (gnutls_session_t session, opaque * data,
int datalen)
{
uint8_t session_id_len;
int pos = 0, ret;
uint16_t suite_size, comp_size;
gnutls_protocol_t adv_version;
int neg_version;
int len = datalen;
opaque rnd[TLS_RANDOM_SIZE], *suite_ptr, *comp_ptr;
if (session->internal... | DoS | 0 | _gnutls_read_client_hello (gnutls_session_t session, opaque * data,
int datalen)
{
uint8_t session_id_len;
int pos = 0, ret;
uint16_t suite_size, comp_size;
gnutls_protocol_t adv_version;
int neg_version;
int len = datalen;
opaque rnd[TLS_RANDOM_SIZE], *suite_ptr, *comp_ptr;
if (session->internal... | @@ -1003,6 +1003,14 @@ _gnutls_recv_handshake_header (gnutls_session_t session,
*recv_type = session->internals.handshake_header_buffer.recv_type;
+ if (*recv_type != type)
+ {
+ gnutls_assert ();
+ _gnutls_handshake_log
+ ("HSK[%x]: Handshake type mismatch (under attack?... | CWE-189 | null | null |
9,671 | _gnutls_recv_finished (gnutls_session_t session)
{
uint8_t data[36], *vrfy;
int data_size;
int ret;
int vrfysize;
ret =
_gnutls_recv_handshake (session, &vrfy, &vrfysize,
GNUTLS_HANDSHAKE_FINISHED, MANDATORY_PACKET);
if (ret < 0)
{
ERR ("recv finished int", ret);
gnutls_assert ()... | DoS | 0 | _gnutls_recv_finished (gnutls_session_t session)
{
uint8_t data[36], *vrfy;
int data_size;
int ret;
int vrfysize;
ret =
_gnutls_recv_handshake (session, &vrfy, &vrfysize,
GNUTLS_HANDSHAKE_FINISHED, MANDATORY_PACKET);
if (ret < 0)
{
ERR ("recv finished int", ret);
gnutls_assert ()... | @@ -1003,6 +1003,14 @@ _gnutls_recv_handshake_header (gnutls_session_t session,
*recv_type = session->internals.handshake_header_buffer.recv_type;
+ if (*recv_type != type)
+ {
+ gnutls_assert ();
+ _gnutls_handshake_log
+ ("HSK[%x]: Handshake type mismatch (under attack?... | CWE-189 | null | null |
9,672 | _gnutls_send_finished (gnutls_session_t session, int again)
{
uint8_t data[36];
int ret;
int data_size = 0;
if (again == 0)
{
/* This is needed in order to hash all the required
* messages.
*/
if ((ret = _gnutls_handshake_hash_pending (session)) < 0)
{
gnutls_assert ();
r... | DoS | 0 | _gnutls_send_finished (gnutls_session_t session, int again)
{
uint8_t data[36];
int ret;
int data_size = 0;
if (again == 0)
{
/* This is needed in order to hash all the required
* messages.
*/
if ((ret = _gnutls_handshake_hash_pending (session)) < 0)
{
gnutls_assert ();
r... | @@ -1003,6 +1003,14 @@ _gnutls_recv_handshake_header (gnutls_session_t session,
*recv_type = session->internals.handshake_header_buffer.recv_type;
+ if (*recv_type != type)
+ {
+ gnutls_assert ();
+ _gnutls_handshake_log
+ ("HSK[%x]: Handshake type mismatch (under attack?... | CWE-189 | null | null |
9,673 | _gnutls_send_handshake (gnutls_session_t session, void *i_data,
uint32_t i_datasize,
gnutls_handshake_description_t type)
{
int ret;
uint8_t *data;
uint32_t datasize;
int pos = 0;
if (i_data == NULL && i_datasize == 0)
{
/* we are resuming a previously interrupted
* send.
*/
... | DoS | 0 | _gnutls_send_handshake (gnutls_session_t session, void *i_data,
uint32_t i_datasize,
gnutls_handshake_description_t type)
{
int ret;
uint8_t *data;
uint32_t datasize;
int pos = 0;
if (i_data == NULL && i_datasize == 0)
{
/* we are resuming a previously interrupted
* send.
*/
... | @@ -1003,6 +1003,14 @@ _gnutls_recv_handshake_header (gnutls_session_t session,
*recv_type = session->internals.handshake_header_buffer.recv_type;
+ if (*recv_type != type)
+ {
+ gnutls_assert ();
+ _gnutls_handshake_log
+ ("HSK[%x]: Handshake type mismatch (under attack?... | CWE-189 | null | null |
9,674 | _gnutls_set_client_random (gnutls_session_t session, uint8_t * rnd)
{
memcpy (session->security_parameters.client_random, rnd, TLS_RANDOM_SIZE);
}
| DoS | 0 | _gnutls_set_client_random (gnutls_session_t session, uint8_t * rnd)
{
memcpy (session->security_parameters.client_random, rnd, TLS_RANDOM_SIZE);
}
| @@ -1003,6 +1003,14 @@ _gnutls_recv_handshake_header (gnutls_session_t session,
*recv_type = session->internals.handshake_header_buffer.recv_type;
+ if (*recv_type != type)
+ {
+ gnutls_assert ();
+ _gnutls_handshake_log
+ ("HSK[%x]: Handshake type mismatch (under attack?... | CWE-189 | null | null |
9,675 | _gnutls_set_server_random (gnutls_session_t session, uint8_t * rnd)
{
memcpy (session->security_parameters.server_random, rnd, TLS_RANDOM_SIZE);
}
| DoS | 0 | _gnutls_set_server_random (gnutls_session_t session, uint8_t * rnd)
{
memcpy (session->security_parameters.server_random, rnd, TLS_RANDOM_SIZE);
}
| @@ -1003,6 +1003,14 @@ _gnutls_recv_handshake_header (gnutls_session_t session,
*recv_type = session->internals.handshake_header_buffer.recv_type;
+ if (*recv_type != type)
+ {
+ gnutls_assert ();
+ _gnutls_handshake_log
+ ("HSK[%x]: Handshake type mismatch (under attack?... | CWE-189 | null | null |
9,676 | _gnutls_ssl3_finished (gnutls_session_t session, int type, opaque * ret)
{
const int siz = SSL_MSG_LEN;
digest_hd_st td_md5;
digest_hd_st td_sha;
const char *mesg;
int rc;
rc = _gnutls_hash_copy (&td_md5, &session->internals.handshake_mac_handle_md5);
if (rc < 0)
{
gnutls_assert ();
retur... | DoS | 0 | _gnutls_ssl3_finished (gnutls_session_t session, int type, opaque * ret)
{
const int siz = SSL_MSG_LEN;
digest_hd_st td_md5;
digest_hd_st td_sha;
const char *mesg;
int rc;
rc = _gnutls_hash_copy (&td_md5, &session->internals.handshake_mac_handle_md5);
if (rc < 0)
{
gnutls_assert ();
retur... | @@ -1003,6 +1003,14 @@ _gnutls_recv_handshake_header (gnutls_session_t session,
*recv_type = session->internals.handshake_header_buffer.recv_type;
+ if (*recv_type != type)
+ {
+ gnutls_assert ();
+ _gnutls_handshake_log
+ ("HSK[%x]: Handshake type mismatch (under attack?... | CWE-189 | null | null |
9,677 | _gnutls_tls_create_random (opaque * dst)
{
uint32_t tim;
int ret;
/* Use weak random numbers for the most of the
* buffer except for the first 4 that are the
* system's time.
*/
tim = time (NULL);
/* generate server random value */
_gnutls_write_uint32 (tim, dst);
ret = _gnutls_rnd (RND_NONCE,... | DoS | 0 | _gnutls_tls_create_random (opaque * dst)
{
uint32_t tim;
int ret;
/* Use weak random numbers for the most of the
* buffer except for the first 4 that are the
* system's time.
*/
tim = time (NULL);
/* generate server random value */
_gnutls_write_uint32 (tim, dst);
ret = _gnutls_rnd (RND_NONCE,... | @@ -1003,6 +1003,14 @@ _gnutls_recv_handshake_header (gnutls_session_t session,
*recv_type = session->internals.handshake_header_buffer.recv_type;
+ if (*recv_type != type)
+ {
+ gnutls_assert ();
+ _gnutls_handshake_log
+ ("HSK[%x]: Handshake type mismatch (under attack?... | CWE-189 | null | null |
9,678 | int _gnutls_user_hello_func( gnutls_session session, gnutls_protocol_t adv_version)
{
int ret;
if (session->internals.user_hello_func != NULL)
{
ret = session->internals.user_hello_func( session);
if (ret < 0)
{
gnutls_assert();
return ret;
}
/* Here we nee... | DoS | 0 | int _gnutls_user_hello_func( gnutls_session session, gnutls_protocol_t adv_version)
{
int ret;
if (session->internals.user_hello_func != NULL)
{
ret = session->internals.user_hello_func( session);
if (ret < 0)
{
gnutls_assert();
return ret;
}
/* Here we nee... | @@ -1003,6 +1003,14 @@ _gnutls_recv_handshake_header (gnutls_session_t session,
*recv_type = session->internals.handshake_header_buffer.recv_type;
+ if (*recv_type != type)
+ {
+ gnutls_assert ();
+ _gnutls_handshake_log
+ ("HSK[%x]: Handshake type mismatch (under attack?... | CWE-189 | null | null |
9,679 | static int decode_format80(GetByteContext *gb, int src_size,
unsigned char *dest, int dest_size, int check_size) {
int dest_index = 0;
int count, opcode, start;
int src_pos;
unsigned char color;
int i;
start = bytestream2_tell(gb);
while (bytestream2_tell(gb) - start < src_size) {
... | DoS Exec Code Overflow | 0 | static int decode_format80(GetByteContext *gb, int src_size,
unsigned char *dest, int dest_size, int check_size) {
int dest_index = 0;
int count, opcode, start;
int src_pos;
unsigned char color;
int i;
start = bytestream2_tell(gb);
while (bytestream2_tell(gb) - start < src_size) {
... | @@ -151,6 +151,12 @@ static av_cold int vqa_decode_init(AVCodecContext *avctx)
return -1;
}
+ if (s->width & (s->vector_width - 1) ||
+ s->height & (s->vector_height - 1)) {
+ av_log(avctx, AV_LOG_ERROR, "Image size not multiple of block size\n");
+ return AVERROR_INVALIDDATA;
... | CWE-119 | null | null |
9,680 | static int vqa_decode_chunk(VqaContext *s)
{
unsigned int chunk_type;
unsigned int chunk_size;
int byte_skip;
unsigned int index = 0;
int i;
unsigned char r, g, b;
int index_shift;
int res;
int cbf0_chunk = -1;
int cbfz_chunk = -1;
int cbp0_chunk = -1;
int cbpz_chunk = -... | DoS Exec Code Overflow | 0 | static int vqa_decode_chunk(VqaContext *s)
{
unsigned int chunk_type;
unsigned int chunk_size;
int byte_skip;
unsigned int index = 0;
int i;
unsigned char r, g, b;
int index_shift;
int res;
int cbf0_chunk = -1;
int cbfz_chunk = -1;
int cbp0_chunk = -1;
int cbpz_chunk = -... | @@ -151,6 +151,12 @@ static av_cold int vqa_decode_init(AVCodecContext *avctx)
return -1;
}
+ if (s->width & (s->vector_width - 1) ||
+ s->height & (s->vector_height - 1)) {
+ av_log(avctx, AV_LOG_ERROR, "Image size not multiple of block size\n");
+ return AVERROR_INVALIDDATA;
... | CWE-119 | null | null |
9,681 | static int vqa_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
AVPacket *avpkt)
{
VqaContext *s = avctx->priv_data;
int res;
if (s->frame.data[0])
avctx->release_buffer(avctx, &s->frame);
if (avctx->get_buffer(avctx, &s->f... | DoS Exec Code Overflow | 0 | static int vqa_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
AVPacket *avpkt)
{
VqaContext *s = avctx->priv_data;
int res;
if (s->frame.data[0])
avctx->release_buffer(avctx, &s->frame);
if (avctx->get_buffer(avctx, &s->f... | @@ -151,6 +151,12 @@ static av_cold int vqa_decode_init(AVCodecContext *avctx)
return -1;
}
+ if (s->width & (s->vector_width - 1) ||
+ s->height & (s->vector_height - 1)) {
+ av_log(avctx, AV_LOG_ERROR, "Image size not multiple of block size\n");
+ return AVERROR_INVALIDDATA;
... | CWE-119 | null | null |
9,682 | PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
{
const unsigned char *cursor, *limit, *marker, *start;
zval **rval_ref;
limit = max;
cursor = *p;
if (YYCURSOR >= YYLIMIT) {
return 0;
}
if (var_hash && cursor[0] != 'R') {
var_push(var_hash, rval);
}
start = cursor;
#line 478 "ext/standard... | DoS Exec Code Overflow | 0 | PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
{
const unsigned char *cursor, *limit, *marker, *start;
zval **rval_ref;
limit = max;
cursor = *p;
if (YYCURSOR >= YYLIMIT) {
return 0;
}
if (var_hash && cursor[0] != 'R') {
var_push(var_hash, rval);
}
start = cursor;
#line 478 "ext/standard... | @@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Sat Jun 21 21:27:56 2014 */
+/* Generated by re2c 0.13.5 */
#line 1 "ext/standard/var_unserializer.re"
/*
+----------------------------------------------------------------------+
@@ -372,7 +372,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_en... | CWE-189 | null | null |
9,683 | PHPAPI void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval)
{
var_entries *var_hash = (*var_hashx)->last_dtor;
#if VAR_ENTRIES_DBG
fprintf(stderr, "var_push_dtor(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval));
#endif
if (!var_hash || var_hash->used_slots == VAR_ENTRIES_MAX) {
var_h... | DoS Exec Code Overflow | 0 | PHPAPI void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval)
{
var_entries *var_hash = (*var_hashx)->last_dtor;
#if VAR_ENTRIES_DBG
fprintf(stderr, "var_push_dtor(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(rval));
#endif
if (!var_hash || var_hash->used_slots == VAR_ENTRIES_MAX) {
var_h... | @@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Sat Jun 21 21:27:56 2014 */
+/* Generated by re2c 0.13.5 */
#line 1 "ext/standard/var_unserializer.re"
/*
+----------------------------------------------------------------------+
@@ -372,7 +372,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_en... | CWE-189 | null | null |
9,684 | XMLRPC_VALUE XMLRPC_CopyValue(XMLRPC_VALUE value) {
if(value) {
value->iRefCount ++;
#ifdef XMLRPC_DEBUG_REFCOUNT
if(value->id.str) {
printf ("incremented refcount of %s, now %i\n", value->id.str,
value->iRefCount);
}
else {
printf ("incremented refcount of 0x%x, now %i\n", value,
... | DoS Overflow | 0 | XMLRPC_VALUE XMLRPC_CopyValue(XMLRPC_VALUE value) {
if(value) {
value->iRefCount ++;
#ifdef XMLRPC_DEBUG_REFCOUNT
if(value->id.str) {
printf ("incremented refcount of %s, now %i\n", value->id.str,
value->iRefCount);
}
else {
printf ("incremented refcount of 0x%x, now %i\n", value,
... | @@ -219,16 +219,19 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
n = 10;
tm.tm_mon = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+4])
tm.tm_mon += (text[i+4]-'0')*n;
n /= 10;
}
tm.tm_mon --;
+ if(tm.tm_mon < 0 || t... | CWE-119 | null | null |
9,685 | XMLRPC_VALUE XMLRPC_CreateValueBase64(const char* id, const char* s, int len) {
XMLRPC_VALUE val = XMLRPC_CreateValueEmpty();
if(val) {
XMLRPC_SetValueBase64(val, s, len);
if(id) {
XMLRPC_SetValueID(val, id, 0);
}
}
return val;
}
| DoS Overflow | 0 | XMLRPC_VALUE XMLRPC_CreateValueBase64(const char* id, const char* s, int len) {
XMLRPC_VALUE val = XMLRPC_CreateValueEmpty();
if(val) {
XMLRPC_SetValueBase64(val, s, len);
if(id) {
XMLRPC_SetValueID(val, id, 0);
}
}
return val;
}
| @@ -219,16 +219,19 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
n = 10;
tm.tm_mon = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+4])
tm.tm_mon += (text[i+4]-'0')*n;
n /= 10;
}
tm.tm_mon --;
+ if(tm.tm_mon < 0 || t... | CWE-119 | null | null |
9,686 | XMLRPC_VALUE XMLRPC_CreateValueDateTime(const char* id, time_t time) {
XMLRPC_VALUE val = XMLRPC_CreateValueEmpty();
if(val) {
XMLRPC_SetValueDateTime(val, time);
if(id) {
XMLRPC_SetValueID(val, id, 0);
}
}
return val;
}
| DoS Overflow | 0 | XMLRPC_VALUE XMLRPC_CreateValueDateTime(const char* id, time_t time) {
XMLRPC_VALUE val = XMLRPC_CreateValueEmpty();
if(val) {
XMLRPC_SetValueDateTime(val, time);
if(id) {
XMLRPC_SetValueID(val, id, 0);
}
}
return val;
}
| @@ -219,16 +219,19 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
n = 10;
tm.tm_mon = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+4])
tm.tm_mon += (text[i+4]-'0')*n;
n /= 10;
}
tm.tm_mon --;
+ if(tm.tm_mon < 0 || t... | CWE-119 | null | null |
9,687 | XMLRPC_VALUE XMLRPC_CreateValueDateTime_ISO8601(const char* id, const char *s) {
XMLRPC_VALUE val = XMLRPC_CreateValueEmpty();
if(val) {
XMLRPC_SetValueDateTime_ISO8601(val, s);
if(id) {
XMLRPC_SetValueID(val, id, 0);
}
}
return val;
}
| DoS Overflow | 0 | XMLRPC_VALUE XMLRPC_CreateValueDateTime_ISO8601(const char* id, const char *s) {
XMLRPC_VALUE val = XMLRPC_CreateValueEmpty();
if(val) {
XMLRPC_SetValueDateTime_ISO8601(val, s);
if(id) {
XMLRPC_SetValueID(val, id, 0);
}
}
return val;
}
| @@ -219,16 +219,19 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
n = 10;
tm.tm_mon = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+4])
tm.tm_mon += (text[i+4]-'0')*n;
n /= 10;
}
tm.tm_mon --;
+ if(tm.tm_mon < 0 || t... | CWE-119 | null | null |
9,688 | XMLRPC_VALUE XMLRPC_CreateValueDouble(const char* id, double d) {
XMLRPC_VALUE val = XMLRPC_CreateValueEmpty();
if(val) {
XMLRPC_SetValueDouble(val, d);
if(id) {
XMLRPC_SetValueID(val, id, 0);
}
}
return val;
}
| DoS Overflow | 0 | XMLRPC_VALUE XMLRPC_CreateValueDouble(const char* id, double d) {
XMLRPC_VALUE val = XMLRPC_CreateValueEmpty();
if(val) {
XMLRPC_SetValueDouble(val, d);
if(id) {
XMLRPC_SetValueID(val, id, 0);
}
}
return val;
}
| @@ -219,16 +219,19 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
n = 10;
tm.tm_mon = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+4])
tm.tm_mon += (text[i+4]-'0')*n;
n /= 10;
}
tm.tm_mon --;
+ if(tm.tm_mon < 0 || t... | CWE-119 | null | null |
9,689 | XMLRPC_VALUE XMLRPC_DupValueNew (XMLRPC_VALUE xSource) {
XMLRPC_VALUE xReturn = NULL;
if (xSource) {
xReturn = XMLRPC_CreateValueEmpty ();
if (xSource->id.len) {
XMLRPC_SetValueID (xReturn, xSource->id.str, xSource->id.len);
}
switch (xSource->type) {
case xmlrpc_int:
case xmlrpc_boolean:
XMLRPC_Se... | DoS Overflow | 0 | XMLRPC_VALUE XMLRPC_DupValueNew (XMLRPC_VALUE xSource) {
XMLRPC_VALUE xReturn = NULL;
if (xSource) {
xReturn = XMLRPC_CreateValueEmpty ();
if (xSource->id.len) {
XMLRPC_SetValueID (xReturn, xSource->id.str, xSource->id.len);
}
switch (xSource->type) {
case xmlrpc_int:
case xmlrpc_boolean:
XMLRPC_Se... | @@ -219,16 +219,19 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
n = 10;
tm.tm_mon = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+4])
tm.tm_mon += (text[i+4]-'0')*n;
n /= 10;
}
tm.tm_mon --;
+ if(tm.tm_mon < 0 || t... | CWE-119 | null | null |
9,690 | void XMLRPC_Free(void* mem) {
my_free(mem);
}
| DoS Overflow | 0 | void XMLRPC_Free(void* mem) {
my_free(mem);
}
| @@ -219,16 +219,19 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
n = 10;
tm.tm_mon = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+4])
tm.tm_mon += (text[i+4]-'0')*n;
n /= 10;
}
tm.tm_mon --;
+ if(tm.tm_mon < 0 || t... | CWE-119 | null | null |
9,691 | XMLRPC_CASE XMLRPC_GetDefaultIdCase() {
XMLRPC_OPTIONS options = XMLRPC_GetDefaultOptions();
return options->id_case;
}
| DoS Overflow | 0 | XMLRPC_CASE XMLRPC_GetDefaultIdCase() {
XMLRPC_OPTIONS options = XMLRPC_GetDefaultOptions();
return options->id_case;
}
| @@ -219,16 +219,19 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
n = 10;
tm.tm_mon = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+4])
tm.tm_mon += (text[i+4]-'0')*n;
n /= 10;
}
tm.tm_mon --;
+ if(tm.tm_mon < 0 || t... | CWE-119 | null | null |
9,692 | XMLRPC_CASE_COMPARISON XMLRPC_GetDefaultIdCaseComparison() {
XMLRPC_OPTIONS options = XMLRPC_GetDefaultOptions();
return options->id_case_compare;
}
| DoS Overflow | 0 | XMLRPC_CASE_COMPARISON XMLRPC_GetDefaultIdCaseComparison() {
XMLRPC_OPTIONS options = XMLRPC_GetDefaultOptions();
return options->id_case_compare;
}
| @@ -219,16 +219,19 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
n = 10;
tm.tm_mon = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+4])
tm.tm_mon += (text[i+4]-'0')*n;
n /= 10;
}
tm.tm_mon --;
+ if(tm.tm_mon < 0 || t... | CWE-119 | null | null |
9,693 | static XMLRPC_OPTIONS XMLRPC_GetDefaultOptions() {
static STRUCT_XMLRPC_OPTIONS options = {
xmlrpc_case_exact,
xmlrpc_case_sensitive
};
return &options;
}
| DoS Overflow | 0 | static XMLRPC_OPTIONS XMLRPC_GetDefaultOptions() {
static STRUCT_XMLRPC_OPTIONS options = {
xmlrpc_case_exact,
xmlrpc_case_sensitive
};
return &options;
}
| @@ -219,16 +219,19 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
n = 10;
tm.tm_mon = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+4])
tm.tm_mon += (text[i+4]-'0')*n;
n /= 10;
}
tm.tm_mon --;
+ if(tm.tm_mon < 0 || t... | CWE-119 | null | null |
9,694 | XMLRPC_SERVER XMLRPC_GetGlobalServer() {
static XMLRPC_SERVER xsServer = 0;
if(!xsServer) {
xsServer = XMLRPC_ServerCreate();
}
return xsServer;
}
| DoS Overflow | 0 | XMLRPC_SERVER XMLRPC_GetGlobalServer() {
static XMLRPC_SERVER xsServer = 0;
if(!xsServer) {
xsServer = XMLRPC_ServerCreate();
}
return xsServer;
}
| @@ -219,16 +219,19 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
n = 10;
tm.tm_mon = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+4])
tm.tm_mon += (text[i+4]-'0')*n;
n /= 10;
}
tm.tm_mon --;
+ if(tm.tm_mon < 0 || t... | CWE-119 | null | null |
9,695 | int XMLRPC_GetResponseFaultCode(XMLRPC_REQUEST response) {
return XMLRPC_GetValueFaultCode( XMLRPC_RequestGetData(response) );
}
| DoS Overflow | 0 | int XMLRPC_GetResponseFaultCode(XMLRPC_REQUEST response) {
return XMLRPC_GetValueFaultCode( XMLRPC_RequestGetData(response) );
}
| @@ -219,16 +219,19 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
n = 10;
tm.tm_mon = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+4])
tm.tm_mon += (text[i+4]-'0')*n;
n /= 10;
}
tm.tm_mon --;
+ if(tm.tm_mon < 0 || t... | CWE-119 | null | null |
9,696 | const char* XMLRPC_GetResponseFaultString (XMLRPC_REQUEST response) {
return XMLRPC_GetValueFaultString( XMLRPC_RequestGetData(response) );
}
| DoS Overflow | 0 | const char* XMLRPC_GetResponseFaultString (XMLRPC_REQUEST response) {
return XMLRPC_GetValueFaultString( XMLRPC_RequestGetData(response) );
}
| @@ -219,16 +219,19 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
n = 10;
tm.tm_mon = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+4])
tm.tm_mon += (text[i+4]-'0')*n;
n /= 10;
}
tm.tm_mon --;
+ if(tm.tm_mon < 0 || t... | CWE-119 | null | null |
9,697 | const char* XMLRPC_GetValueBase64(XMLRPC_VALUE value) {
return ((value && value->type == xmlrpc_base64) ? value->str.str : 0);
}
| DoS Overflow | 0 | const char* XMLRPC_GetValueBase64(XMLRPC_VALUE value) {
return ((value && value->type == xmlrpc_base64) ? value->str.str : 0);
}
| @@ -219,16 +219,19 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
n = 10;
tm.tm_mon = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+4])
tm.tm_mon += (text[i+4]-'0')*n;
n /= 10;
}
tm.tm_mon --;
+ if(tm.tm_mon < 0 || t... | CWE-119 | null | null |
9,698 | int XMLRPC_GetValueBoolean(XMLRPC_VALUE value) {
return ((value && value->type == xmlrpc_boolean) ? value->i : 0);
}
| DoS Overflow | 0 | int XMLRPC_GetValueBoolean(XMLRPC_VALUE value) {
return ((value && value->type == xmlrpc_boolean) ? value->i : 0);
}
| @@ -219,16 +219,19 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
n = 10;
tm.tm_mon = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+4])
tm.tm_mon += (text[i+4]-'0')*n;
n /= 10;
}
tm.tm_mon --;
+ if(tm.tm_mon < 0 || t... | CWE-119 | null | null |
9,699 | time_t XMLRPC_GetValueDateTime(XMLRPC_VALUE value) {
return (time_t)((value && value->type == xmlrpc_datetime) ? value->i : 0);
}
| DoS Overflow | 0 | time_t XMLRPC_GetValueDateTime(XMLRPC_VALUE value) {
return (time_t)((value && value->type == xmlrpc_datetime) ? value->i : 0);
}
| @@ -219,16 +219,19 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
n = 10;
tm.tm_mon = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+4])
tm.tm_mon += (text[i+4]-'0')*n;
n /= 10;
}
tm.tm_mon --;
+ if(tm.tm_mon < 0 || t... | CWE-119 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.