"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "crypto/asn1/x_bignum.c" between
openssl-1.0.2t.tar.gz and openssl-1.0.2u.tar.gz

About: OpenSSL is a toolkit implementing the Transport Layer Security (TLS) and Secure Sockets Layer (SSL v2/v3) protocols as well as a full-strength general purpose cryptography library. Long Term Support (LTS) version (support will be provided until end of 2019).

x_bignum.c  (openssl-1.0.2t):x_bignum.c  (openssl-1.0.2u)
/* x_bignum.c */ /* x_bignum.c */
/* /*
* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
* 2000. * 2000.
*/ */
/* ==================================================================== /* ====================================================================
* Copyright (c) 2000 The OpenSSL Project. All rights reserved. * Copyright (c) 2000-2019 The OpenSSL Project. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:
* *
* 1. Redistributions of source code must retain the above copyright * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright * 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in * notice, this list of conditions and the following disclaimer in
skipping to change at line 105 skipping to change at line 105
ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &bignum_pf, 0, "BIGNUM" ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &bignum_pf, 0, "BIGNUM"
ASN1_ITEM_end(BIGNUM) ASN1_ITEM_end(BIGNUM)
ASN1_ITEM_start(CBIGNUM) ASN1_ITEM_start(CBIGNUM)
ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &bignum_pf, BN_SENSITIVE, "BIGNUM" ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &bignum_pf, BN_SENSITIVE, "BIGNUM"
ASN1_ITEM_end(CBIGNUM) ASN1_ITEM_end(CBIGNUM)
static int bn_new(ASN1_VALUE **pval, const ASN1_ITEM *it) static int bn_new(ASN1_VALUE **pval, const ASN1_ITEM *it)
{ {
*pval = (ASN1_VALUE *)BN_new(); *pval = (ASN1_VALUE *)BN_new();
if (*pval) if (*pval != NULL)
return 1; return 1;
else else
return 0; return 0;
} }
static void bn_free(ASN1_VALUE **pval, const ASN1_ITEM *it) static void bn_free(ASN1_VALUE **pval, const ASN1_ITEM *it)
{ {
if (!*pval) if (*pval == NULL)
return; return;
if (it->size & BN_SENSITIVE) if (it->size & BN_SENSITIVE)
BN_clear_free((BIGNUM *)*pval); BN_clear_free((BIGNUM *)*pval);
else else
BN_free((BIGNUM *)*pval); BN_free((BIGNUM *)*pval);
*pval = NULL; *pval = NULL;
} }
static int bn_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, static int bn_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype,
const ASN1_ITEM *it) const ASN1_ITEM *it)
{ {
BIGNUM *bn; BIGNUM *bn;
int pad; int pad;
if (!*pval) if (*pval == NULL)
return -1; return -1;
bn = (BIGNUM *)*pval; bn = (BIGNUM *)*pval;
/* If MSB set in an octet we need a padding byte */ /* If MSB set in an octet we need a padding byte */
if (BN_num_bits(bn) & 0x7) if (BN_num_bits(bn) & 0x7)
pad = 0; pad = 0;
else else
pad = 1; pad = 1;
if (cont) { if (cont) {
if (pad) if (pad)
*cont++ = 0; *cont++ = 0;
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)