diff options
Diffstat (limited to 'crypto/rc5')
-rw-r--r-- | crypto/rc5/asm/rc5-586.pl | 5 | ||||
-rw-r--r-- | crypto/rc5/build.info | 29 | ||||
-rw-r--r-- | crypto/rc5/rc5_ecb.c | 10 | ||||
-rw-r--r-- | crypto/rc5/rc5_enc.c | 10 | ||||
-rw-r--r-- | crypto/rc5/rc5_local.h | 2 | ||||
-rw-r--r-- | crypto/rc5/rc5_skey.c | 19 | ||||
-rw-r--r-- | crypto/rc5/rc5cfb64.c | 10 | ||||
-rw-r--r-- | crypto/rc5/rc5ofb64.c | 10 |
8 files changed, 74 insertions, 21 deletions
diff --git a/crypto/rc5/asm/rc5-586.pl b/crypto/rc5/asm/rc5-586.pl index af11be816259..6def6fcacb0f 100644 --- a/crypto/rc5/asm/rc5-586.pl +++ b/crypto/rc5/asm/rc5-586.pl @@ -1,7 +1,7 @@ #! /usr/bin/env perl # Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. # -# Licensed under the OpenSSL license (the "License"). You may not use +# Licensed under the Apache License 2.0 (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy # in the file LICENSE in the source distribution or at # https://www.openssl.org/source/license.html @@ -12,8 +12,7 @@ push(@INC,"${dir}","${dir}../../perlasm"); require "x86asm.pl"; require "cbc.pl"; -$output = pop; -open STDOUT,">$output"; +$output = pop and open STDOUT,">$output"; &asm_init($ARGV[0]); diff --git a/crypto/rc5/build.info b/crypto/rc5/build.info index 928a62cd85bf..1b396252bb5c 100644 --- a/crypto/rc5/build.info +++ b/crypto/rc5/build.info @@ -1,7 +1,26 @@ LIBS=../../libcrypto -SOURCE[../../libcrypto]=\ - rc5_skey.c rc5_ecb.c {- $target{rc5_asm_src} -} rc5cfb64.c rc5ofb64.c -GENERATE[rc5-586.s]=asm/rc5-586.pl \ - $(PERLASM_SCHEME) $(LIB_CFLAGS) $(LIB_CPPFLAGS) -DEPEND[rc5-586.s]=../perlasm/x86asm.pl ../perlasm/cbc.pl +$RC5ASM=rc5_enc.c +IF[{- !$disabled{asm} -}] + $RC5ASM_x86=rc5-586.S + + # Now that we have defined all the arch specific variables, use the + # appropriate one, and define the appropriate macros + IF[$RC5ASM_{- $target{asm_arch} -}] + $RC5ASM=$RC5ASM_{- $target{asm_arch} -} + $RC5DEF=RC5_ASM + ENDIF +ENDIF + +$ALL=rc5_skey.c rc5_ecb.c $RC5ASM rc5cfb64.c rc5ofb64.c + +SOURCE[../../libcrypto]=$ALL + +# When all deprecated symbols are removed, libcrypto doesn't export the +# rc5 functions, so we must include them directly in liblegacy.a +IF[{- $disabled{'deprecated-3.0'} && !$disabled{module} && !$disabled{shared} -}] + SOURCE[../../providers/liblegacy.a]=$ALL +ENDIF + +GENERATE[rc5-586.S]=asm/rc5-586.pl +DEPEND[rc5-586.S]=../perlasm/x86asm.pl ../perlasm/cbc.pl diff --git a/crypto/rc5/rc5_ecb.c b/crypto/rc5/rc5_ecb.c index 94ec646390dd..e533b9ea7e19 100644 --- a/crypto/rc5/rc5_ecb.c +++ b/crypto/rc5/rc5_ecb.c @@ -1,12 +1,18 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * - * Licensed under the OpenSSL license (the "License"). You may not use + * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ +/* + * RC5 low level APIs are deprecated for public use, but still ok for internal + * use. + */ +#include "internal/deprecated.h" + #include <openssl/rc5.h> #include "rc5_local.h" #include <openssl/opensslv.h> diff --git a/crypto/rc5/rc5_enc.c b/crypto/rc5/rc5_enc.c index 75ddeb2eaf2b..2f9feee0e0f8 100644 --- a/crypto/rc5/rc5_enc.c +++ b/crypto/rc5/rc5_enc.c @@ -1,12 +1,18 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * - * Licensed under the OpenSSL license (the "License"). You may not use + * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ +/* + * RC5 low level APIs are deprecated for public use, but still ok for internal + * use. + */ +#include "internal/deprecated.h" + #include <stdio.h> #include <openssl/rc5.h> #include "rc5_local.h" diff --git a/crypto/rc5/rc5_local.h b/crypto/rc5/rc5_local.h index 41130fe33be4..df7df608dc07 100644 --- a/crypto/rc5/rc5_local.h +++ b/crypto/rc5/rc5_local.h @@ -1,7 +1,7 @@ /* * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. * - * Licensed under the OpenSSL license (the "License"). You may not use + * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html diff --git a/crypto/rc5/rc5_skey.c b/crypto/rc5/rc5_skey.c index b2e6bbb1af24..a08b940badf6 100644 --- a/crypto/rc5/rc5_skey.c +++ b/crypto/rc5/rc5_skey.c @@ -1,21 +1,30 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * - * Licensed under the OpenSSL license (the "License"). You may not use + * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ +/* + * RC5 low level APIs are deprecated for public use, but still ok for internal + * use. + */ +#include "internal/deprecated.h" + #include <openssl/rc5.h> #include "rc5_local.h" -void RC5_32_set_key(RC5_32_KEY *key, int len, const unsigned char *data, - int rounds) +int RC5_32_set_key(RC5_32_KEY *key, int len, const unsigned char *data, + int rounds) { RC5_32_INT L[64], l, ll, A, B, *S, k; int i, j, m, c, t, ii, jj; + if (len > 255) + return 0; + if ((rounds != RC5_16_ROUNDS) && (rounds != RC5_12_ROUNDS) && (rounds != RC5_8_ROUNDS)) rounds = RC5_16_ROUNDS; @@ -58,4 +67,6 @@ void RC5_32_set_key(RC5_32_KEY *key, int len, const unsigned char *data, if (++jj >= c) jj = 0; } + + return 1; } diff --git a/crypto/rc5/rc5cfb64.c b/crypto/rc5/rc5cfb64.c index cfce7ec1e84c..9088eb7eddae 100644 --- a/crypto/rc5/rc5cfb64.c +++ b/crypto/rc5/rc5cfb64.c @@ -1,12 +1,18 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * - * Licensed under the OpenSSL license (the "License"). You may not use + * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ +/* + * RC5 low level APIs are deprecated for public use, but still ok for internal + * use. + */ +#include "internal/deprecated.h" + #include <openssl/rc5.h> #include "rc5_local.h" diff --git a/crypto/rc5/rc5ofb64.c b/crypto/rc5/rc5ofb64.c index 224eb968579c..b1128b1f4806 100644 --- a/crypto/rc5/rc5ofb64.c +++ b/crypto/rc5/rc5ofb64.c @@ -1,12 +1,18 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * - * Licensed under the OpenSSL license (the "License"). You may not use + * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ +/* + * RC5 low level APIs are deprecated for public use, but still ok for internal + * use. + */ +#include "internal/deprecated.h" + #include <openssl/rc5.h> #include "rc5_local.h" |