diff options
author | Jason King <jason.king@joyent.com> | 2020-05-27 19:04:52 -0500 |
---|---|---|
committer | Jason King <jason.king@joyent.com> | 2020-06-15 12:48:01 -0500 |
commit | 989c147e4f8311ee853a577bac8009cc7ffc4a73 (patch) | |
tree | 05809647bb71380f73c688d7471078ef1c9edbb0 | |
parent | 772852a5d3501d23ca0f77fcdbd7ddb0a25da28b (diff) | |
download | illumos-joyent-989c147e4f8311ee853a577bac8009cc7ffc4a73.tar.gz |
12796 pcks11_softtoken C_GetMechanismList() should validate its arguments
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Reviewed by: Sebastian Wiedenroth <wiedi@frubar.net>
Reviewed by: Juraj Lutter <juraj@lutter.sk>
Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r-- | usr/src/lib/pkcs11/pkcs11_softtoken/common/softSlotToken.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr/src/lib/pkcs11/pkcs11_softtoken/common/softSlotToken.c b/usr/src/lib/pkcs11/pkcs11_softtoken/common/softSlotToken.c index 88cf9d98da..16f98a5c1c 100644 --- a/usr/src/lib/pkcs11/pkcs11_softtoken/common/softSlotToken.c +++ b/usr/src/lib/pkcs11/pkcs11_softtoken/common/softSlotToken.c @@ -21,7 +21,7 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2018, Joyent, Inc. + * Copyright 2020 Joyent, Inc. */ #include <strings.h> @@ -418,6 +418,9 @@ C_GetMechanismList(CK_SLOT_ID slotID, CK_MECHANISM_TYPE_PTR pMechanismList, if (slotID != SOFTTOKEN_SLOTID) return (CKR_SLOT_ID_INVALID); + if (pulCount == NULL) + return (CKR_ARGUMENTS_BAD); + mechnum = sizeof (soft_mechanisms) / sizeof (CK_MECHANISM_TYPE); if (pMechanismList == NULL) { |