projects
/
platform
/
core
/
security
/
drm-service-core-tizen.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Migrate to openssl 1.1
[platform/core/security/drm-service-core-tizen.git]
/
test
/
drm_testutil.cpp
diff --git
a/test/drm_testutil.cpp
b/test/drm_testutil.cpp
index
c235c09
..
5b25fed
100644
(file)
--- a/
test/drm_testutil.cpp
+++ b/
test/drm_testutil.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 2000-201
5 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2000-201
9 Samsung Electronics Co., Ltd. All rights reserved
*
* Licensed under the Flora License, Version 1.1 (the License);
* you may not use this file except in compliance with the License.
*
* Licensed under the Flora License, Version 1.1 (the License);
* you may not use this file except in compliance with the License.
@@
-52,17
+52,6
@@
static unsigned char g_baAESKey[32] = {
};
};
-int __initialized = _UNINITIALIZED;
-
-void __init_crypto()
-{
- if (__initialized != _INITIALIZED) {
- ERR_load_crypto_strings();
- OpenSSL_add_all_algorithms();
- __initialized = _INITIALIZED;
- }
-}
-
int __get_random_bytes(char *output, int random_len)
{
FILE *fp = fopen("/dev/urandom", "r");
int __get_random_bytes(char *output, int random_len)
{
FILE *fp = fopen("/dev/urandom", "r");
@@
-201,6
+190,7
@@
int _create_dh_key(const char *dh_key_p_hex, const char *dh_key_g_hex,
{
int ret = DRMTEST_SUCCESS;
DH *pDH = NULL;
{
int ret = DRMTEST_SUCCESS;
DH *pDH = NULL;
+ BIGNUM *p = NULL, *g = NULL;
if ((pDH = DH_new()) == NULL) {
printf("...FAIL: DH_new() error");
if ((pDH = DH_new()) == NULL) {
printf("...FAIL: DH_new() error");
@@
-208,11
+198,12
@@
int _create_dh_key(const char *dh_key_p_hex, const char *dh_key_g_hex,
goto error;
}
goto error;
}
- BN_hex2bn(&(pDH->p), dh_key_p_hex);
- BN_hex2bn(&(pDH->g), dh_key_g_hex);
+ BN_hex2bn(&p, dh_key_p_hex);
+ BN_hex2bn(&g, dh_key_g_hex);
+ DH_set0_pqg(pDH, p, nullptr, g);
/* Set a to run with normal modexp and b to use constant time */
/* Set a to run with normal modexp and b to use constant time */
-
pDH->flags &= ~DH_FLAG_NO_EXP_CONSTTIME
;
+
DH_clear_flags(pDH, DH_FLAG_NO_EXP_CONSTTIME)
;
// Generate DH Key
if (!DH_generate_key(pDH)) {
// Generate DH Key
if (!DH_generate_key(pDH)) {
@@
-241,7
+232,7
@@
int _free_dh_key(DH *pkey)
int _get_dh_hex_pubkey(const DH *pkey, char **dh_pubkey)
{
int _get_dh_hex_pubkey(const DH *pkey, char **dh_pubkey)
{
- *dh_pubkey = BN_bn2hex(
pkey->pub_key
);
+ *dh_pubkey = BN_bn2hex(
DH_get0_pub_key(pkey)
);
return DRMTEST_SUCCESS;
}
return DRMTEST_SUCCESS;
}