projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow oversized buffers for provider cipher IV fetch
[openssl.git]
/
providers
/
implementations
/
ciphers
/
ciphercommon_gcm.c
diff --git
a/providers/implementations/ciphers/ciphercommon_gcm.c
b/providers/implementations/ciphers/ciphercommon_gcm.c
index
a64462a
..
7daa8dc
100644
(file)
--- a/
providers/implementations/ciphers/ciphercommon_gcm.c
+++ b/
providers/implementations/ciphers/ciphercommon_gcm.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019
-2020
The OpenSSL Project Authors. All Rights Reserved.
*
* 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
*
* 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
@@
-156,11
+156,12
@@
int gcm_get_ctx_params(void *vctx, OSSL_PARAM params[])
if (p != NULL) {
if (ctx->iv_gen != 1 && ctx->iv_gen_rand != 1)
return 0;
if (p != NULL) {
if (ctx->iv_gen != 1 && ctx->iv_gen_rand != 1)
return 0;
- if (ctx->ivlen
!=
p->data_size) {
+ if (ctx->ivlen
>
p->data_size) {
ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
return 0;
}
ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
return 0;
}
- if (!OSSL_PARAM_set_octet_string(p, ctx->iv, ctx->ivlen)) {
+ if (!OSSL_PARAM_set_octet_string(p, ctx->iv, ctx->ivlen)
+ && !OSSL_PARAM_set_octet_ptr(p, &ctx->iv, ctx->ivlen)) {
ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
return 0;
}
ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
return 0;
}