summaryrefslogtreecommitdiff
path: root/Cryptlib
diff options
context:
space:
mode:
authorMathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>2015-05-10 10:03:20 -0400
committerMathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>2015-05-10 10:03:20 -0400
commit86a08c30b489047d29cd84188c30fe2bc13ff1e9 (patch)
treeecfef5f1808b45a6e28b6524d70a3b24d40170fd /Cryptlib
parent37358ddb1cdda9a677d34f0635113bf2d542e025 (diff)
downloadefi-boot-shim-86a08c30b489047d29cd84188c30fe2bc13ff1e9.tar.gz
efi-boot-shim-86a08c30b489047d29cd84188c30fe2bc13ff1e9.zip
Reapplying all patches
Diffstat (limited to 'Cryptlib')
-rw-r--r--Cryptlib/Library/BaseMemoryLib.h41
-rw-r--r--Cryptlib/OpenSSL/crypto/conf/conf_def.c2
-rw-r--r--Cryptlib/OpenSSL/crypto/conf/conf_lib.c2
-rw-r--r--Cryptlib/OpenSSL/crypto/conf/conf_sap.c2
-rw-r--r--Cryptlib/OpenSSL/crypto/engine/eng_openssl.c4
-rw-r--r--Cryptlib/OpenSSL/crypto/x509/by_dir.c8
-rw-r--r--Cryptlib/OpenSSL/crypto/x509v3/v3_pci.c2
7 files changed, 61 insertions, 0 deletions
diff --git a/Cryptlib/Library/BaseMemoryLib.h b/Cryptlib/Library/BaseMemoryLib.h
new file mode 100644
index 00000000..471a055a
--- /dev/null
+++ b/Cryptlib/Library/BaseMemoryLib.h
@@ -0,0 +1,41 @@
+#ifndef __BASE_MEMORY_LIB__
+#define __BASE_MEMORY_LIB__
+
+CHAR8 *
+ScanMem8 (
+ IN CHAR8 *Buffer,
+ IN UINTN Size,
+ IN CHAR8 Value
+ );
+
+UINT32
+WriteUnaligned32(
+ UINT32 *Buffer,
+ UINT32 Value
+ );
+
+CHAR8 *
+AsciiStrCat(
+ CHAR8 *Destination,
+ CHAR8 *Source
+ );
+
+CHAR8 *
+AsciiStrCpy(
+ CHAR8 *Destination,
+ CHAR8 *Source
+ );
+
+CHAR8 *
+AsciiStrnCpy(
+ CHAR8 *Destination,
+ CHAR8 *Source,
+ UINTN count
+ );
+
+UINTN
+AsciiStrSize(
+ CHAR8 *string
+ );
+
+#endif
diff --git a/Cryptlib/OpenSSL/crypto/conf/conf_def.c b/Cryptlib/OpenSSL/crypto/conf/conf_def.c
index a168339b..ede10689 100644
--- a/Cryptlib/OpenSSL/crypto/conf/conf_def.c
+++ b/Cryptlib/OpenSSL/crypto/conf/conf_def.c
@@ -186,11 +186,13 @@ static int def_load(CONF *conf, const char *name, long *line)
int ret;
BIO *in=NULL;
+#ifndef OPENSSL_NO_STDIO
#ifdef OPENSSL_SYS_VMS
in=BIO_new_file(name, "r");
#else
in=BIO_new_file(name, "rb");
#endif
+#endif
if (in == NULL)
{
if (ERR_GET_REASON(ERR_peek_last_error()) == BIO_R_NO_SUCH_FILE)
diff --git a/Cryptlib/OpenSSL/crypto/conf/conf_lib.c b/Cryptlib/OpenSSL/crypto/conf/conf_lib.c
index 2a3399d2..7f54d3d8 100644
--- a/Cryptlib/OpenSSL/crypto/conf/conf_lib.c
+++ b/Cryptlib/OpenSSL/crypto/conf/conf_lib.c
@@ -92,11 +92,13 @@ LHASH *CONF_load(LHASH *conf, const char *file, long *eline)
LHASH *ltmp;
BIO *in=NULL;
+#ifndef OPENSSL_NO_STDIO
#ifdef OPENSSL_SYS_VMS
in=BIO_new_file(file, "r");
#else
in=BIO_new_file(file, "rb");
#endif
+#endif
if (in == NULL)
{
CONFerr(CONF_F_CONF_LOAD,ERR_R_SYS_LIB);
diff --git a/Cryptlib/OpenSSL/crypto/conf/conf_sap.c b/Cryptlib/OpenSSL/crypto/conf/conf_sap.c
index 760dc263..35f4a272 100644
--- a/Cryptlib/OpenSSL/crypto/conf/conf_sap.c
+++ b/Cryptlib/OpenSSL/crypto/conf/conf_sap.c
@@ -93,12 +93,14 @@ void OPENSSL_config(const char *config_name)
{
BIO *bio_err;
ERR_load_crypto_strings();
+#ifndef OPENSSL_NO_STDIO
if ((bio_err=BIO_new_fp(stderr, BIO_NOCLOSE)) != NULL)
{
BIO_printf(bio_err,"Auto configuration failed\n");
ERR_print_errors(bio_err);
BIO_free(bio_err);
}
+#endif
exit(1);
}
diff --git a/Cryptlib/OpenSSL/crypto/engine/eng_openssl.c b/Cryptlib/OpenSSL/crypto/engine/eng_openssl.c
index 7c139ae2..f1307039 100644
--- a/Cryptlib/OpenSSL/crypto/engine/eng_openssl.c
+++ b/Cryptlib/OpenSSL/crypto/engine/eng_openssl.c
@@ -374,11 +374,15 @@ static EVP_PKEY *openssl_load_privkey(ENGINE *eng, const char *key_id,
BIO *in;
EVP_PKEY *key;
fprintf(stderr, "(TEST_ENG_OPENSSL_PKEY)Loading Private key %s\n", key_id);
+#ifndef OPENSSL_NO_STDIO
in = BIO_new_file(key_id, "r");
if (!in)
return NULL;
key = PEM_read_bio_PrivateKey(in, NULL, 0, NULL);
BIO_free(in);
+#else
+ return NULL;
+#endif
return key;
}
#endif
diff --git a/Cryptlib/OpenSSL/crypto/x509/by_dir.c b/Cryptlib/OpenSSL/crypto/x509/by_dir.c
index b3acd80f..dc2e7df8 100644
--- a/Cryptlib/OpenSSL/crypto/x509/by_dir.c
+++ b/Cryptlib/OpenSSL/crypto/x509/by_dir.c
@@ -92,8 +92,10 @@ static int dir_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, long argl,
static int new_dir(X509_LOOKUP *lu);
static void free_dir(X509_LOOKUP *lu);
static int add_cert_dir(BY_DIR *ctx,const char *dir,int type);
+#ifndef OPENSSL_NO_STDIO
static int get_cert_by_subject(X509_LOOKUP *xl,int type,X509_NAME *name,
X509_OBJECT *ret);
+#endif
X509_LOOKUP_METHOD x509_dir_lookup=
{
"Load certs from files in a directory",
@@ -102,7 +104,11 @@ X509_LOOKUP_METHOD x509_dir_lookup=
NULL, /* init */
NULL, /* shutdown */
dir_ctrl, /* ctrl */
+#ifdef OPENSSL_NO_STDIO
+ NULL, /* get_by_subject */
+#else
get_cert_by_subject, /* get_by_subject */
+#endif
NULL, /* get_by_issuer_serial */
NULL, /* get_by_fingerprint */
NULL, /* get_by_alias */
@@ -242,6 +248,7 @@ static int add_cert_dir(BY_DIR *ctx, const char *dir, int type)
return(1);
}
+#ifndef OPENSSL_NO_STDIO
static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name,
X509_OBJECT *ret)
{
@@ -383,3 +390,4 @@ finish:
if (b != NULL) BUF_MEM_free(b);
return(ok);
}
+#endif
diff --git a/Cryptlib/OpenSSL/crypto/x509v3/v3_pci.c b/Cryptlib/OpenSSL/crypto/x509v3/v3_pci.c
index 823e9afc..b6f5a612 100644
--- a/Cryptlib/OpenSSL/crypto/x509v3/v3_pci.c
+++ b/Cryptlib/OpenSSL/crypto/x509v3/v3_pci.c
@@ -157,6 +157,7 @@ static int process_pci_value(CONF_VALUE *val,
}
OPENSSL_free(tmp_data2);
}
+#ifndef OPENSSL_NO_STDIO
else if (strncmp(val->value, "file:", 5) == 0)
{
unsigned char buf[2048];
@@ -194,6 +195,7 @@ static int process_pci_value(CONF_VALUE *val,
goto err;
}
}
+#endif
else if (strncmp(val->value, "text:", 5) == 0)
{
val_len = strlen(val->value + 5);