Commit e91f74f8 authored by ROOL's avatar ROOL 🤖
Browse files

Fix ordering issue on init and text clipping

Detail:
  When AcornHTTP starts it tries to register itself with URL, which triggers a service call (for HTTP arriving) which in turn triggers AcornSSL to (re)report it is loaded. However, if AcornSSL is loaded *before* HTTP then the service call is missed because HTTP's service call handler isn't yet linked into the service call chain.
  Fix this by looking for a telltale SWI in security_init().
Admin:
  Reported by Matthew Phillips when trying to load URL/HTTP on a system on which AcornSSL had been loaded beforehand.
  Also clip the text shown by *URLProtoShow to end at the closing bracket of the date (more recent AcornSSL modules add the version of mbedTLS to which they were linked, which spilled over the column end).

Version 1.01. Tagged as 'HTTP-1_01'
parent 74324bbb
/* (1.00) /* (1.01)
* *
* This file is automatically maintained by srccommit, do not edit manually. * This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1. * Last processed by srccommit version: 1.1.
* *
*/ */
#define Module_MajorVersion_CMHG 1.00 #define Module_MajorVersion_CMHG 1.01
#define Module_MinorVersion_CMHG #define Module_MinorVersion_CMHG
#define Module_Date_CMHG 25 Sep 2018 #define Module_Date_CMHG 25 Mar 2019
#define Module_MajorVersion "1.00" #define Module_MajorVersion "1.01"
#define Module_Version 100 #define Module_Version 101
#define Module_MinorVersion "" #define Module_MinorVersion ""
#define Module_Date "25 Sep 2018" #define Module_Date "25 Mar 2019"
#define Module_ApplicationDate "25-Sep-18" #define Module_ApplicationDate "25-Mar-19"
#define Module_ComponentName "HTTP" #define Module_ComponentName "HTTP"
#define Module_ComponentPath "castle/RiscOS/Sources/Networking/Fetchers/HTTP" #define Module_ComponentPath "apache/RiscOS/Sources/Networking/Fetchers/HTTP"
#define Module_FullVersion "1.00" #define Module_FullVersion "1.01"
#define Module_HelpVersion "1.00 (25 Sep 2018)" #define Module_HelpVersion "1.01 (25 Mar 2019)"
#define Module_LibraryVersionInfo "1:0" #define Module_LibraryVersionInfo "1:1"
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include "config.h" #include "config.h"
#include "security.h" #include "security.h"
volatile static int callback_pending_flag = 0; static volatile int callback_pending_flag = 0;
#define NO_SUCH_SWI (0x1E6) #define NO_SUCH_SWI (0x1E6)
...@@ -113,7 +113,7 @@ static _kernel_oserror *try_to_register_for_https(void) ...@@ -113,7 +113,7 @@ static _kernel_oserror *try_to_register_for_https(void)
strcpy(info, "Acorn SSL Acorn 1998"); strcpy(info, "Acorn SSL Acorn 1998");
if (bracket) { if (bracket) {
strcat(info, " (Built: "); strcat(info, " (Built: ");
strcat(info, bracket + 1); strncat(info, bracket + 1, sizeof("dd-Mmm-YYYY)"));
} }
e = _swix(URL_PROTOCOL_REGISTER, _INR(0,4), 0, HTTP_SecureGetData, "https:", e = _swix(URL_PROTOCOL_REGISTER, _INR(0,4), 0, HTTP_SecureGetData, "https:",
ver, info); ver, info);
......
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
#include "sys/errno.h" #include "sys/errno.h"
#include "sys/types.h" #include "sys/types.h"
#include "sys/socket.h" #include "sys/socket.h"
#include "sys/dcistructs.h"
#include "Interface/AcornSSL.h"
#include "module.h" #include "module.h"
#include "socklib.h" #include "socklib.h"
#include "security.h" #include "security.h"
...@@ -51,7 +53,10 @@ int security_ssl_available(void) ...@@ -51,7 +53,10 @@ int security_ssl_available(void)
void security_init(void) void security_init(void)
{ {
ssl_module_present = 0; int ver = 0; /* If error, use zero */
_swix(AcornSSL_Version, _OUT(0), &ver);
security_ssl_arrived(ver);
} }
int security_ssl_arrived(int ver) int security_ssl_arrived(int ver)
...@@ -153,9 +158,6 @@ static int sec_recv(int s, void *data, size_t size, int flags) ...@@ -153,9 +158,6 @@ static int sec_recv(int s, void *data, size_t size, int flags)
#else #else
#include "sys/dcistructs.h"
#include "Interface/AcornSSL.h"
static int sec_socketioctl(int s, unsigned long op, ...) static int sec_socketioctl(int s, unsigned long op, ...)
{ {
_kernel_oserror *e; _kernel_oserror *e;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment