Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 647914
Collapse All | Expand All

(-)a/src/fileio.c (+1 lines)
Lines 40-45 Link Here
40
#include <openssl/pem.h>
40
#include <openssl/pem.h>
41
#include <openssl/err.h>
41
#include <openssl/err.h>
42
#include <openssl/engine.h>
42
#include <openssl/engine.h>
43
#include <openssl/ui.h>
43
44
44
#include <ccan/talloc/talloc.h>
45
#include <ccan/talloc/talloc.h>
45
#include <ccan/read_write_all/read_write_all.h>
46
#include <ccan/read_write_all/read_write_all.h>
(-)a/src/idc.c (+8 lines)
Lines 238-244 struct idc *IDC_get(PKCS7 *p7, BIO *bio) Link Here
238
238
239
	/* extract the idc from the signed PKCS7 'other' data */
239
	/* extract the idc from the signed PKCS7 'other' data */
240
	str = p7->d.sign->contents->d.other->value.asn1_string;
240
	str = p7->d.sign->contents->d.other->value.asn1_string;
241
#if OPENSSL_VERSION_NUMBER < 0x10100000L
241
	idcbuf = buf = ASN1_STRING_data(str);
242
	idcbuf = buf = ASN1_STRING_data(str);
243
#else
244
	idcbuf = buf = ASN1_STRING_get0_data(str);
245
#endif
242
	idc = d2i_IDC(NULL, &buf, ASN1_STRING_length(str));
246
	idc = d2i_IDC(NULL, &buf, ASN1_STRING_length(str));
243
247
244
	/* If we were passed a BIO, write the idc data, minus type and length,
248
	/* If we were passed a BIO, write the idc data, minus type and length,
Lines 289-295 int IDC_check_hash(struct idc *idc, struct image *image) Link Here
289
	}
293
	}
290
294
291
	/* check hash against the one we calculated from the image */
295
	/* check hash against the one we calculated from the image */
296
#if OPENSSL_VERSION_NUMBER < 0x10100000L
292
	buf = ASN1_STRING_data(str);
297
	buf = ASN1_STRING_data(str);
298
#else
299
	buf = ASN1_STRING_get0_data(str);
300
#endif
293
	if (memcmp(buf, sha, sizeof(sha))) {
301
	if (memcmp(buf, sha, sizeof(sha))) {
294
		fprintf(stderr, "Hash doesn't match image\n");
302
		fprintf(stderr, "Hash doesn't match image\n");
295
		fprintf(stderr, " got:       %s\n", sha256_str(buf));
303
		fprintf(stderr, " got:       %s\n", sha256_str(buf));
(-)a/src/sbattach.c (+2 lines)
Lines 231-236 int main(int argc, char **argv) Link Here
231
		return EXIT_FAILURE;
231
		return EXIT_FAILURE;
232
	}
232
	}
233
233
234
#if OPENSSL_VERSION_NUMBER < 0x10100000L
234
	ERR_load_crypto_strings();
235
	ERR_load_crypto_strings();
235
	OpenSSL_add_all_digests();
236
	OpenSSL_add_all_digests();
236
	OPENSSL_config(NULL);
237
	OPENSSL_config(NULL);
Lines 239-244 int main(int argc, char **argv) Link Here
239
	 * module isn't present).  In either case ignore the errors
240
	 * module isn't present).  In either case ignore the errors
240
	 * (malloc will cause other failures out lower down */
241
	 * (malloc will cause other failures out lower down */
241
	ERR_clear_error();
242
	ERR_clear_error();
243
#endif
242
244
243
	image = image_load(image_filename);
245
	image = image_load(image_filename);
244
	if (!image) {
246
	if (!image) {
(-)a/src/sbkeysync.c (+6 lines)
Lines 208-214 static int x509_key_parse(struct key *key, uint8_t *data, size_t len) Link Here
208
		goto out;
208
		goto out;
209
209
210
	key->id_len = ASN1_STRING_length(serial);
210
	key->id_len = ASN1_STRING_length(serial);
211
#if OPENSSL_VERSION_NUMBER < 0x10100000L
211
	key->id = talloc_memdup(key, ASN1_STRING_data(serial), key->id_len);
212
	key->id = talloc_memdup(key, ASN1_STRING_data(serial), key->id_len);
213
#else
214
	key->id = talloc_memdup(key, ASN1_STRING_get0_data(serial), key->id_len);
215
#endif
212
216
213
	key->description = talloc_array(key, char, description_len);
217
	key->description = talloc_array(key, char, description_len);
214
	X509_NAME_oneline(X509_get_subject_name(x509),
218
	X509_NAME_oneline(X509_get_subject_name(x509),
Lines 927-932 int main(int argc, char **argv) Link Here
927
		return EXIT_FAILURE;
931
		return EXIT_FAILURE;
928
	}
932
	}
929
933
934
#if OPENSSL_VERSION_NUMBER < 0x10100000L
930
	ERR_load_crypto_strings();
935
	ERR_load_crypto_strings();
931
	OpenSSL_add_all_digests();
936
	OpenSSL_add_all_digests();
932
	OpenSSL_add_all_ciphers();
937
	OpenSSL_add_all_ciphers();
Lines 936-941 int main(int argc, char **argv) Link Here
936
	 * module isn't present).  In either case ignore the errors
941
	 * module isn't present).  In either case ignore the errors
937
	 * (malloc will cause other failures out lower down */
942
	 * (malloc will cause other failures out lower down */
938
	ERR_clear_error();
943
	ERR_clear_error();
944
#endif
939
945
940
	ctx->filesystem_keys = init_keyset(ctx);
946
	ctx->filesystem_keys = init_keyset(ctx);
941
	ctx->firmware_keys = init_keyset(ctx);
947
	ctx->firmware_keys = init_keyset(ctx);
(-)a/src/sbsign.c (+2 lines)
Lines 188-193 int main(int argc, char **argv) Link Here
188
188
189
	talloc_steal(ctx, ctx->image);
189
	talloc_steal(ctx, ctx->image);
190
190
191
#if OPENSSL_VERSION_NUMBER < 0x10100000L
191
	ERR_load_crypto_strings();
192
	ERR_load_crypto_strings();
192
	OpenSSL_add_all_digests();
193
	OpenSSL_add_all_digests();
193
	OpenSSL_add_all_ciphers();
194
	OpenSSL_add_all_ciphers();
Lines 197-202 int main(int argc, char **argv) Link Here
197
	 * module isn't present).  In either case ignore the errors
198
	 * module isn't present).  In either case ignore the errors
198
	 * (malloc will cause other failures out lower down */
199
	 * (malloc will cause other failures out lower down */
199
	ERR_clear_error();
200
	ERR_clear_error();
201
#endif
200
	if (engine)
202
	if (engine)
201
		pkey = fileio_read_engine_key(engine, keyfilename);
203
		pkey = fileio_read_engine_key(engine, keyfilename);
202
	else
204
	else
(-)a/src/sbvarsign.c (+2 lines)
Lines 509-514 int main(int argc, char **argv) Link Here
509
		return EXIT_FAILURE;
509
		return EXIT_FAILURE;
510
	}
510
	}
511
511
512
#if OPENSSL_VERSION_NUMBER < 0x10100000L
512
	/* initialise openssl */
513
	/* initialise openssl */
513
	OpenSSL_add_all_digests();
514
	OpenSSL_add_all_digests();
514
	OpenSSL_add_all_ciphers();
515
	OpenSSL_add_all_ciphers();
Lines 519-524 int main(int argc, char **argv) Link Here
519
	 * module isn't present).  In either case ignore the errors
520
	 * module isn't present).  In either case ignore the errors
520
	 * (malloc will cause other failures out lower down */
521
	 * (malloc will cause other failures out lower down */
521
	ERR_clear_error();
522
	ERR_clear_error();
523
#endif
522
524
523
	/* set up the variable signing context */
525
	/* set up the variable signing context */
524
	varname = argv[optind];
526
	varname = argv[optind];
(-)a/src/sbverify.c (+2 lines)
Lines 250-255 int main(int argc, char **argv) Link Here
250
	verbose = false;
250
	verbose = false;
251
	detached_sig_filename = NULL;
251
	detached_sig_filename = NULL;
252
252
253
#if OPENSSL_VERSION_NUMBER < 0x10100000L
253
	OpenSSL_add_all_digests();
254
	OpenSSL_add_all_digests();
254
	ERR_load_crypto_strings();
255
	ERR_load_crypto_strings();
255
	OPENSSL_config(NULL);
256
	OPENSSL_config(NULL);
Lines 258-263 int main(int argc, char **argv) Link Here
258
	 * module isn't present).  In either case ignore the errors
259
	 * module isn't present).  In either case ignore the errors
259
	 * (malloc will cause other failures out lower down */
260
	 * (malloc will cause other failures out lower down */
260
	ERR_clear_error();
261
	ERR_clear_error();
262
#endif
261
263
262
	for (;;) {
264
	for (;;) {
263
		int idx;
265
		int idx;

Return to bug 647914