ec_key.c (openssl-1.1.1o) | : | ec_key.c (openssl-1.1.1p) | ||
---|---|---|---|---|
/* | /* | |||
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved. | * Copyright 2002-2022 The OpenSSL Project Authors. All Rights Reserved. | |||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved | * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved | |||
* | * | |||
* Licensed under the OpenSSL license (the "License"). You may not use | * Licensed under the OpenSSL license (the "License"). You may not use | |||
* this file except in compliance with the License. You can obtain a copy | * this file except in compliance with the License. You can obtain a copy | |||
* in the file LICENSE in the source distribution or at | * in the file LICENSE in the source distribution or at | |||
* https://www.openssl.org/source/license.html | * https://www.openssl.org/source/license.html | |||
*/ | */ | |||
#include "internal/cryptlib.h" | #include "internal/cryptlib.h" | |||
#include <string.h> | #include <string.h> | |||
skipping to change at line 659 | skipping to change at line 659 | |||
} | } | |||
int ec_key_simple_oct2priv(EC_KEY *eckey, const unsigned char *buf, size_t len) | int ec_key_simple_oct2priv(EC_KEY *eckey, const unsigned char *buf, size_t len) | |||
{ | { | |||
if (eckey->priv_key == NULL) | if (eckey->priv_key == NULL) | |||
eckey->priv_key = BN_secure_new(); | eckey->priv_key = BN_secure_new(); | |||
if (eckey->priv_key == NULL) { | if (eckey->priv_key == NULL) { | |||
ECerr(EC_F_EC_KEY_SIMPLE_OCT2PRIV, ERR_R_MALLOC_FAILURE); | ECerr(EC_F_EC_KEY_SIMPLE_OCT2PRIV, ERR_R_MALLOC_FAILURE); | |||
return 0; | return 0; | |||
} | } | |||
eckey->priv_key = BN_bin2bn(buf, len, eckey->priv_key); | if (BN_bin2bn(buf, len, eckey->priv_key) == NULL) { | |||
if (eckey->priv_key == NULL) { | ||||
ECerr(EC_F_EC_KEY_SIMPLE_OCT2PRIV, ERR_R_BN_LIB); | ECerr(EC_F_EC_KEY_SIMPLE_OCT2PRIV, ERR_R_BN_LIB); | |||
return 0; | return 0; | |||
} | } | |||
return 1; | return 1; | |||
} | } | |||
size_t EC_KEY_priv2buf(const EC_KEY *eckey, unsigned char **pbuf) | size_t EC_KEY_priv2buf(const EC_KEY *eckey, unsigned char **pbuf) | |||
{ | { | |||
size_t len; | size_t len; | |||
unsigned char *buf; | unsigned char *buf; | |||
End of changes. 2 change blocks. | ||||
3 lines changed or deleted | 2 lines changed or added |