Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
ce1811f9
Unverified
Commit
ce1811f9
authored
Jun 06, 2020
by
Rémi Verschelde
Committed by
GitHub
Jun 06, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #39338 from Faless/crypto/instantiate_fix
Crypto virtual methods, fix editor crash when mbedtls is disabled
parents
17af0104
87cc283b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
18 deletions
+12
-18
crypto.cpp
core/crypto/crypto.cpp
+1
-13
crypto.h
core/crypto/crypto.h
+3
-3
dtls_server.cpp
core/io/dtls_server.cpp
+4
-1
packet_peer_dtls.cpp
core/io/packet_peer_dtls.cpp
+4
-1
No files found.
core/crypto/crypto.cpp
View file @
ce1811f9
...
...
@@ -70,7 +70,7 @@ Crypto *Crypto::create() {
if
(
_create
)
{
return
_create
();
}
return
memnew
(
Crypto
);
ERR_FAIL_V_MSG
(
nullptr
,
"Crypto is not available when the mbedtls module is disabled."
);
}
void
Crypto
::
load_default_certificates
(
String
p_path
)
{
...
...
@@ -85,18 +85,6 @@ void Crypto::_bind_methods() {
ClassDB
::
bind_method
(
D_METHOD
(
"generate_self_signed_certificate"
,
"key"
,
"issuer_name"
,
"not_before"
,
"not_after"
),
&
Crypto
::
generate_self_signed_certificate
,
DEFVAL
(
"CN=myserver,O=myorganisation,C=IT"
),
DEFVAL
(
"20140101000000"
),
DEFVAL
(
"20340101000000"
));
}
PackedByteArray
Crypto
::
generate_random_bytes
(
int
p_bytes
)
{
ERR_FAIL_V_MSG
(
PackedByteArray
(),
"generate_random_bytes is not available when mbedtls module is disabled."
);
}
Ref
<
CryptoKey
>
Crypto
::
generate_rsa
(
int
p_bytes
)
{
ERR_FAIL_V_MSG
(
nullptr
,
"generate_rsa is not available when mbedtls module is disabled."
);
}
Ref
<
X509Certificate
>
Crypto
::
generate_self_signed_certificate
(
Ref
<
CryptoKey
>
p_key
,
String
p_issuer_name
,
String
p_not_before
,
String
p_not_after
)
{
ERR_FAIL_V_MSG
(
nullptr
,
"generate_self_signed_certificate is not available when mbedtls module is disabled."
);
}
/// Resource loader/saver
RES
ResourceFormatLoaderCrypto
::
load
(
const
String
&
p_path
,
const
String
&
p_original_path
,
Error
*
r_error
,
bool
p_use_sub_threads
,
float
*
r_progress
,
bool
p_no_cache
)
{
...
...
core/crypto/crypto.h
View file @
ce1811f9
...
...
@@ -75,9 +75,9 @@ public:
static
Crypto
*
create
();
static
void
load_default_certificates
(
String
p_path
);
virtual
PackedByteArray
generate_random_bytes
(
int
p_bytes
);
virtual
Ref
<
CryptoKey
>
generate_rsa
(
int
p_bytes
);
virtual
Ref
<
X509Certificate
>
generate_self_signed_certificate
(
Ref
<
CryptoKey
>
p_key
,
String
p_issuer_name
,
String
p_not_before
,
String
p_not_after
);
virtual
PackedByteArray
generate_random_bytes
(
int
p_bytes
)
=
0
;
virtual
Ref
<
CryptoKey
>
generate_rsa
(
int
p_bytes
)
=
0
;
virtual
Ref
<
X509Certificate
>
generate_self_signed_certificate
(
Ref
<
CryptoKey
>
p_key
,
String
p_issuer_name
,
String
p_not_before
,
String
p_not_after
)
=
0
;
Crypto
()
{}
};
...
...
core/io/dtls_server.cpp
View file @
ce1811f9
...
...
@@ -37,7 +37,10 @@ DTLSServer *(*DTLSServer::_create)() = nullptr;
bool
DTLSServer
::
available
=
false
;
DTLSServer
*
DTLSServer
::
create
()
{
return
_create
();
if
(
_create
)
{
return
_create
();
}
return
nullptr
;
}
bool
DTLSServer
::
is_available
()
{
...
...
core/io/packet_peer_dtls.cpp
View file @
ce1811f9
...
...
@@ -36,7 +36,10 @@ PacketPeerDTLS *(*PacketPeerDTLS::_create)() = nullptr;
bool
PacketPeerDTLS
::
available
=
false
;
PacketPeerDTLS
*
PacketPeerDTLS
::
create
()
{
return
_create
();
if
(
_create
)
{
return
_create
();
}
return
nullptr
;
}
bool
PacketPeerDTLS
::
is_available
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment