mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-25 20:02:37 +03:00
fixed some of the bindings for the new API changes
git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@120 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
This commit is contained in:
parent
d40747d1b1
commit
114fff4077
1
Makefile
1
Makefile
@ -85,6 +85,7 @@ ifdef CONFIG_PERL_BINDINGS
|
||||
install -m 755 $(STAGE)/axtlsp.pm `perl -e 'use Config; print $$Config{installarchlib};'`
|
||||
endif
|
||||
@mkdir -p -m 755 $(PREFIX)/include/axTLS
|
||||
install -m 644 crypto/*.h $(PREFIX)/include/axTLS
|
||||
install -m 644 ssl/*.h $(PREFIX)/include/axTLS
|
||||
-rm $(PREFIX)/include/axTLS/cert.h
|
||||
-rm $(PREFIX)/include/axTLS/private_key.h
|
||||
|
@ -275,7 +275,7 @@ JNIEXPORT jint JNICALL Java_axTLSj_axtlsjJNI_getFd(JNIEnv *env, jclass jcls, job
|
||||
|
||||
/* for ssl_session_id() */
|
||||
%typemap(out) const unsigned char * {
|
||||
SV *svs = newSVpv((unsigned char *)\$1, (int)ssl_get_session_id((SSL const *)arg1));
|
||||
SV *svs = newSVpv((unsigned char *)\$1, ssl_get_session_id_size((SSL const *)arg1));
|
||||
\$result = newRV(svs);
|
||||
sv_2mortal(\$result);
|
||||
argvi++;
|
||||
@ -330,7 +330,7 @@ SWIG_TYPEMAP_NUM_ARR(uchar,unsigned char);
|
||||
%typemap(out) const unsigned char * {
|
||||
int i;
|
||||
lua_newtable(L);
|
||||
for (i = 0; i < ssl_get_session_id((SSL const *)\$1); i++){
|
||||
for (i = 0; i < ssl_get_session_id_size((SSL const *)arg1); i++){
|
||||
lua_pushnumber(L,(lua_Number)result[i]);
|
||||
lua_rawseti(L,-2,i+1); /* -1 is the number, -2 is the table */
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ all: lib
|
||||
ifdef CONFIG_PLATFORM_WIN32
|
||||
TARGET=$(AXTLS_HOME)/$(STAGE)/axtlsl.dll
|
||||
else
|
||||
TARGET=$(AXTLS_HOME)/$(STAGE)/axtlsl.so
|
||||
TARGET=$(CONFIG_LUA_CORE)/lib/lua/5.1/axtlsl.so
|
||||
endif
|
||||
|
||||
ifneq ($(MAKECMDGOALS), clean)
|
||||
|
@ -857,11 +857,15 @@ static void display_session_id(SSL *ssl)
|
||||
const uint8_t *session_id = ssl_get_session_id(ssl);
|
||||
int sess_id_size = ssl_get_session_id_size(ssl);
|
||||
|
||||
printf("-----BEGIN SSL SESSION PARAMETERS-----\n");
|
||||
for (i = 0; i < sess_id_size; i++)
|
||||
if (sess_id_size > 0)
|
||||
{
|
||||
printf("%02x", session_id[i]);
|
||||
printf("-----BEGIN SSL SESSION PARAMETERS-----\n");
|
||||
for (i = 0; i < sess_id_size; i++)
|
||||
{
|
||||
printf("%02x", session_id[i]);
|
||||
}
|
||||
|
||||
printf("\n-----END SSL SESSION PARAMETERS-----\n");
|
||||
TTY_FLUSH();
|
||||
}
|
||||
printf("\n-----END SSL SESSION PARAMETERS-----\n");
|
||||
TTY_FLUSH();
|
||||
}
|
||||
|
@ -732,12 +732,15 @@ public class axssl
|
||||
{
|
||||
byte[] session_id = ssl.GetSessionId();
|
||||
|
||||
Console.WriteLine("-----BEGIN SSL SESSION PARAMETERS-----");
|
||||
foreach (byte b in session_id)
|
||||
if (session_id.Length > 0)
|
||||
{
|
||||
Console.Write("{0:x02}", b);
|
||||
}
|
||||
Console.WriteLine("-----BEGIN SSL SESSION PARAMETERS-----");
|
||||
foreach (byte b in session_id)
|
||||
{
|
||||
Console.Write("{0:x02}", b);
|
||||
}
|
||||
|
||||
Console.WriteLine("\n-----END SSL SESSION PARAMETERS-----");
|
||||
Console.WriteLine("\n-----END SSL SESSION PARAMETERS-----");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -737,10 +737,12 @@ public class axssl
|
||||
private void display_session_id(SSL ssl)
|
||||
{
|
||||
byte[] session_id = ssl.getSessionId();
|
||||
int i;
|
||||
|
||||
System.out.println("-----BEGIN SSL SESSION PARAMETERS-----");
|
||||
bytesToHex(session_id);
|
||||
System.out.println("-----END SSL SESSION PARAMETERS-----");
|
||||
if (session_id.length > 0)
|
||||
{
|
||||
System.out.println("-----BEGIN SSL SESSION PARAMETERS-----");
|
||||
bytesToHex(session_id);
|
||||
System.out.println("-----END SSL SESSION PARAMETERS-----");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -527,11 +527,13 @@ function display_session_id(ssl)
|
||||
local session_id = axtlsl.ssl_get_session_id(ssl)
|
||||
local v
|
||||
|
||||
print("-----BEGIN SSL SESSION PARAMETERS-----")
|
||||
for _, v in ipairs(session_id) do
|
||||
io.write(string.format("%02x", v))
|
||||
if #session_id > 0 then
|
||||
print("-----BEGIN SSL SESSION PARAMETERS-----")
|
||||
for _, v in ipairs(session_id) do
|
||||
io.write(string.format("%02x", v))
|
||||
end
|
||||
print("\n-----END SSL SESSION PARAMETERS-----")
|
||||
end
|
||||
print("\n-----END SSL SESSION PARAMETERS-----")
|
||||
end
|
||||
|
||||
--
|
||||
|
@ -235,7 +235,7 @@ sub do_server
|
||||
while (1)
|
||||
{
|
||||
($res, $buf) = axtlsp::ssl_read($ssl, undef);
|
||||
last if $res != $axtlsp::SSL_OK;
|
||||
last if $res < $axtlsp::SSL_OK;
|
||||
|
||||
if ($res == $axtlsp::SSL_OK) # connection established and ok
|
||||
{
|
||||
@ -255,11 +255,11 @@ sub do_server
|
||||
{
|
||||
printf($$buf);
|
||||
}
|
||||
else if ($res < $axtlsp::SSL_OK)
|
||||
elsif ($res < $axtlsp::SSL_OK)
|
||||
{
|
||||
axtlsp::ssl_display_error($res) if not $quiet;
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# client was disconnected or the handshake failed.
|
||||
@ -613,8 +613,10 @@ sub display_session_id
|
||||
{
|
||||
my ($ssl) = @_;
|
||||
my $session_id = axtlsp::ssl_get_session_id($ssl);
|
||||
|
||||
printf("-----BEGIN SSL SESSION PARAMETERS-----\n");
|
||||
printf(unpack("H*", $$session_id));
|
||||
printf("\n-----END SSL SESSION PARAMETERS-----\n");
|
||||
if (length($$session_id) > 0)
|
||||
{
|
||||
printf("-----BEGIN SSL SESSION PARAMETERS-----\n");
|
||||
printf(unpack("H*", $$session_id));
|
||||
printf("\n-----END SSL SESSION PARAMETERS-----\n");
|
||||
}
|
||||
}
|
||||
|
@ -538,14 +538,16 @@ Public Class axssl
|
||||
Private Sub display_session_id(ByVal ssl As SSL)
|
||||
Dim session_id As Byte() = ssl.GetSessionId()
|
||||
|
||||
Console.WriteLine("-----BEGIN SSL SESSION PARAMETERS-----")
|
||||
Dim b As Byte
|
||||
For Each b In session_id
|
||||
Console.Write("{0:x02}", b)
|
||||
Next
|
||||
If session_id.Length > 0 Then
|
||||
Console.WriteLine("-----BEGIN SSL SESSION PARAMETERS-----")
|
||||
Dim b As Byte
|
||||
For Each b In session_id
|
||||
Console.Write("{0:x02}", b)
|
||||
Next
|
||||
|
||||
Console.WriteLine()
|
||||
Console.WriteLine("-----END SSL SESSION PARAMETERS-----")
|
||||
Console.WriteLine()
|
||||
Console.WriteLine("-----END SSL SESSION PARAMETERS-----")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
'
|
||||
|
@ -1504,7 +1504,6 @@ int send_certificate(SSL *ssl)
|
||||
buf[0] = HS_CERTIFICATE;
|
||||
buf[1] = 0;
|
||||
buf[4] = 0;
|
||||
buf[7] = 0;
|
||||
|
||||
while (i < ssl->chain_length)
|
||||
{
|
||||
|
@ -88,9 +88,7 @@ int do_clnt_handshake(SSL *ssl, int handshake_type, uint8_t *buf, int hs_len)
|
||||
if ((ret = send_certificate(ssl)) == SSL_OK &&
|
||||
(ret = send_client_key_xchg(ssl)) == SSL_OK)
|
||||
{
|
||||
ret = (ssl->chain_length == 0) ?
|
||||
SSL_ERROR_INVALID_HANDSHAKE :
|
||||
send_cert_verify(ssl);
|
||||
send_cert_verify(ssl);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user